今天上午做题状态还可以,但下午就感觉状态特别不好,什么都看不懂,都不想干,也许是一整天搞oi弄得心烦了吧。也许我应该把oi和数学调整好时间…… Read More
posted @ 2014-06-01 22:08 ZYF-ZYF Views(158) Comments(0) Diggs(0) Edit
唉,没想出来……注意到预处理的作用。还有CLJ大牛说的话:这么小的数据,想干什么都可以。SPFA预处理+DP 够经典var f:array[0..100,0..100]of longint; a:array[0..20,0..100]of boolean; head,next,go... Read More
posted @ 2014-06-01 11:42 ZYF-ZYF Views(215) Comments(0) Diggs(0) Edit
treap!var i,n,x,y,ans,a,b,root,tot,ft:longint; l,r,s,v,hr:array[0..100000] of longint;procedure r_rotate(var x:longint); var y:longint; begin y:=l[... Read More
posted @ 2014-06-01 10:40 ZYF-ZYF Views(252) Comments(0) Diggs(0) Edit
标准的平衡树。贴个splay吧var v,l,r,fa:array[0..100000] of longint; root,x,i,n,ans:longint;procedure zig(x:longint); var y,z:longint; begin y:=fa[x];z:=fa[y]; if... Read More
posted @ 2014-06-01 10:24 ZYF-ZYF Views(204) Comments(0) Diggs(0) Edit
快速幂水过,贴一下模版。const mo=100003;var x,y,n,m:int64;function power(num,times:int64):int64; var temp:int64; begin if times=1 then exit(num); temp:=power(num,... Read More
posted @ 2014-06-01 10:18 ZYF-ZYF Views(168) Comments(0) Diggs(0) Edit
不得不说块状数组好神奇的啊!这道题的标签可是splay的启发是合并(什么高大上的东西),竟然这么轻松的就解决了!var x,y,i,j,tot,n,m,ch:longint; f,k,l,bl,go:array[0..200100] of longint;procedure init; beg... Read More
posted @ 2014-06-01 09:51 ZYF-ZYF Views(160) Comments(0) Diggs(0) Edit
注意到数列只增不减,而题目中又明确说道my then exit(x) else exit(y); end;procedure build(x,y,k:longint); var mid:longint; begin with t[k] do begin l:=x;r:=y; if ... Read More
posted @ 2014-06-01 09:46 ZYF-ZYF Views(203) Comments(0) Diggs(0) Edit
type node1=record go,next:longint;end; node2=record l,r,mx,sum:longint;end;var i,x,y,n,q,tmp,cnt,sz,code:longint; ch,st:string; fa:a... Read More
posted @ 2014-06-01 00:04 ZYF-ZYF Views(200) Comments(1) Diggs(0) Edit