03 2013 档案
摘要:我太弱了。。。[toggle title="太长了只好折叠起来>_a[i]。1934: [Shoi2007]Vote 善意的投票最大流。建立S,T,同意的向S连边,不同意的向T连边,朋友之间连边,流量都是1.跑最小割。2783: [JLOI2012]树树上倍增。枚举每个点i,if (now+sum[a,i]2761: [JLOI2011]不重复数字平衡树。水题,先查找有没有这个数,没有就加入。24...
阅读全文
摘要:数学期望。总费用=所有边的平均费用和每条边的费用=被优惠且走过的概率*长度,因为长度都是1,所以就是概率。被优惠且走过的概率=优惠路径中包含这条边的概率*走过这条边的概率。=(总包含这条边的路径数/总路径数)^2包含的路径数用两边的点数乘起来就行了。[toggle title="code"][pascal]varn,i,j,k,ee:longint;sum,an,ans:double;now:in...
阅读全文
摘要:sbt:1503: [NOI2004]郁闷的出纳员 [toggle Title="code "][pascal]varl,r,a,size:Array[1..100000]of longint;le:Array[1..100000]of boolean;ans:int64;root,nn,n,m,i,k,j:longint;c,space:char;procedure lr(var x:longi...
阅读全文
摘要:这里什么都有,除了code。。。。^_^(其实什么都没有)
阅读全文
摘要:博客园:http://www.cnblogs.com/lbz007oi/百度空间:http://hi.baidu.com/lbz0072010/cute_loli:http://loli.byethost7.com/
阅读全文
摘要:求出走到每个点有的方法数a[i],再求出每个点到终点的方法数b[i]。每条边走的 次数=a[u[i]]*b[v[i]] 。可以用类spfa按照拓扑序求a[i],把入度为0的点都入栈然后a[e[j]]=a[e[j]]+a[q[h]]求b[i]可以把边反向重新spfa一遍。[toggle Title="code "][pascal]uses math;varu,v,rud,next,e,head:Ar...
阅读全文
摘要:Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!
阅读全文
摘要:This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduc...
阅读全文
摘要:1 var 2 nnn,root,xx,nn,n,m,i,j:longint;ans:int64; 3 l,r,size,a,an,bn,am,bm:array[1..100000]of longint; 4 function new(x:longint):longint; 5 begin 6 inc(nn); 7 size[nn]:=1;a[nn]:=x; exit(nn); 8 end; 9 10 procedure insert(var t,x:longint); 11 begin 12 if t=0 then 13 begi...
阅读全文
摘要:1 const inf=10000000; 2 var 3 other,a,dis,pre,uu,vv,ww,next,head,e,x,long,w:array[0..50100]of longint; 4 v:Array[0..10010]of boolean; 5 tt,c,ee,s,t,i,j,ans,mincost,n,m,k:longint; 6 function min(aa,bb:longint):longint; 7 begin 8 if aa>bb then exit(bb) 9 else exit(aa);10 end;11 12 func...
阅读全文
摘要:1 :loop2 <datamader>.exe3 <slove>.exe4 <program>.exe5 fc <name>.ans <name>.out6 if %errorlevel% == 1 pause7 goto loop程序里没有'<' '>'name是程序名slove是标程program是你的程序注意第5行是.ans 和.out比较datamader不要忘了写 randomize;
阅读全文
摘要:1 var 2 next,e:array[0..700000]of longint; 3 a,l,r,b:Array[0..150000]of longint; 4 aa,son,d,head,top,point,fa,size,w:array[0..300000]of longint; 5 pp,qq,opt,ll,rr,ansa,ansb,root,uu,vv,i,j,n,ee,xx:longint; 6 v:array[0..300000]of boolean; 7 ch,ch1:char; 8 function max(aa,bb:longin...
阅读全文
摘要:1 var 2 max,u,v,ans,s,i,j,k,n,m:longint; 3 p,sum:array[0..100000,0..20]of longint; 4 f,d,x:Array[0..100000]of longint; 5 procedure dou(a:longint); 6 var now,i,j,k:longint; 7 begin 8 now:=x[a]; 9 if a=1 then begin if now=s then inc(ans); exit;end;10 k:=trunc(ln(d[a])/ln(2));11 for ...
阅读全文
摘要:var sum,ee,q,xx,yy,deep,u,c,v,k,i,j,n,m:longint; len,p:array[0..100000,0..20]of longint; a,next,long,e,head,d,f:array[0..100000]of longint;function lca(a,b:longint):longint; var tt,i,j,k:longint; begin if d[a]>d[b] then begin tt:=a;a:=b;b:=tt;end; k:=trunc(ln(d[b])/ln(2)); for i:=k downto 0 ...
阅读全文
摘要:1 var 2 ans,u,v,x,tot,kk,i,j,k,l,n,m,ee,s,t:longint; 3 d,last,next,long,other,e,head,num:array[0..200000]of longint; 4 5 function min(aa,bb:longint):longint; 6 begin 7 if aa>bb then exit(bb) 8 else exit(aa); 9 end;10 11 procedure add(u,v,c:longint);12 begin13 inc(kk);14 other[kk]...
阅读全文