萌新刚学分块,求dalao指教

P3380 【模板】树套树

窝只有一个子语句有时也加上大括号,orz 因为我没想好是不是一个子语句
by codesonic @ 2018-08-21 22:24:31


@[FCBM71](/space/show?uid=45176) 这样很整齐啊qwq
by decoqwq @ 2018-08-21 22:24:32


@[codesonic](/space/show?uid=45443) 我是必加
by decoqwq @ 2018-08-21 22:24:53


@[刘浩宇(寂)](/space/show?uid=48265) 分块在操作较多的情况下最好别使用吧,但您是巨佬啊%%%
by Fading @ 2018-08-21 22:24:58


@[刘浩宇(寂)](/space/show?uid=48265) 我是压行教徒
by FCBM71 @ 2018-08-21 22:25:14


道理我都懂,但是你左括号怎么能换行啊
by AThousandSuns @ 2018-08-21 22:25:20


lxl怒斥明明有log做法偏要根号
by codesonic @ 2018-08-21 22:25:41


道理我都懂,但是你怎么要写暴力数据结构
by Randyhoads @ 2018-08-21 22:26:44


专业压行30年 ``` //T40661 tester program hrn; var a:array[0..32768]of longint; c:array[1..8192,1..6,1..3]of longint; u:array[1..8192]of byte; x:array[1..12]of longint; p2:array[0..4,1..2]of longint; s,t1,t2:string; l,n,p,q,i,j,f,m,t,r:longint; begin readln(n);m:=1; for i:=1 to n do m:=m*2; m:=m div 4; for j:=1 to m*6 do begin readln(s); l:=length(s); for i:=1 to l do if(s[i]='>')or(s[i]='<')or(s[i]='=')then f:=i; for i:=1 to f-1 do t1:=t1+s[i]; for i:=f+1 to l do t2:=t2+s[i]; val(t1,p);val(t2,q); t1:='';t2:=''; if a[p]>0 then begin r:=a[p]; a[q]:=r; inc(u[r]); c[r,u[r],1]:=p; c[r,u[r],2]:=q; c[r,u[r],3]:=ord(s[f]); end else if a[q]>0 then begin r:=a[q]; a[p]:=r; inc(u[r]); c[r,u[r],1]:=p; c[r,u[r],2]:=q; c[r,u[r],3]:=ord(s[f]); end else begin inc(t); a[p]:=t;a[q]:=t; inc(u[t]); c[t,u[t],1]:=p; c[t,u[t],2]:=q; c[t,u[t],3]:=ord(s[f]); end; end; fillchar(a,sizeof(a),0); for i:=1 to m do begin t:=0; for j:=1 to 6 do begin inc(t);x[t]:=c[i,j,1]; inc(t);x[t]:=c[i,j,2]; end; for t:=1 to 11 do for j:=1 to 11 do if x[j]>x[j+1] then begin x[j]:=x[j]+x[j+1]; x[j+1]:=x[j]-x[j+1]; x[j]:=x[j]-x[j+1]; end; p2[1,1]:=x[1];p2[2,1]:=x[4]; p2[3,1]:=x[7];p2[4,1]:=x[10]; for j:=1 to 6 do begin for t:=1 to 4 do if p2[t,1]=c[i,j,1] then p:=t; for t:=1 to 4 do if p2[t,1]=c[i,j,2] then q:=t; case c[i,j,3] of 60:inc(p2[q,2],3); 62:inc(p2[p,2],3); 61:begin inc(p2[p,2]);inc(p2[q,2]);end; end; end; for t:=1 to 3 do for j:=1 to 3 do if(p2[j,2]<p2[j+1,2])or ((p2[j,2]=p2[j+1,2])and(p2[j,1]>p2[j+1,1]))then begin p2[j,2]:=p2[j,2]+p2[j+1,2]; p2[j+1,2]:=p2[j,2]-p2[j+1,2]; p2[j,2]:=p2[j,2]-p2[j+1,2]; p2[j,1]:=p2[j,1]+p2[j+1,1]; p2[j+1,1]:=p2[j,1]-p2[j+1,1]; p2[j,1]:=p2[j,1]-p2[j+1,1]; end; a[p2[1,1]]:=1;a[p2[2,1]]:=1; for j:=1 to 4 do p2[j,2]:=0; end; for i:=1 to m*4 do if a[i]=1 then write(i,' '); readln; end. ```
by FCBM71 @ 2018-08-21 22:27:16


mimi 的压行 ```cpp /*---------------------------------------*/ namespace fib{char b[300000]= {},*f=b;} #define gc ((*fib::f)?(*(fib ::f++)):(fgets(fib::b,sizeof(fib::b),stdin)?(fib::f=fib::b,*(fib::f++)):-1)) inline void in(ll &x){x=0;char c;bool f=0;while((c=gc)>'9'||c<'0')if(c=='-')f=!f;x=c-48;while((c=gc)<='9'&&c>='0')x=x*10+c-48;if(f)x=-x;} namespace fob{char b[300000]= {},*f=b,*g=b+300000-2;} #define pob (fwrite(fob::b,sizeof(char),fob::f-fob::b,stdout),fob::f=fob::b,0) #define pc(x) (*(fob::f++)=(x),(fob::f==fob::g)?pob:0) struct foce{~foce(){pob;fflush(stdout);}} _foce; namespace ib{char b[100];} inline void out(ll x){if(x==0){pc(48);return;}if(x<0){pc('-');x=-x;}char *s=ib::b;while(x) *(++s)=x%10,x/=10;while(s!=ib::b) pc((*(s--))+48);} inline void outn(ll x){out(x);pc('\n');} inline void swap(ll &x,ll &y){ll t=x;x=y;y=t;} inline ll jdz(ll x){return x>0?x:-x;} inline ll max(ll x,ll y){return x>y?x:y;} inline ll min(ll x,ll y){return x<y?x:y;} /*------------------------------------------------------------------------------------------------*/ ``` (快读)
by codesonic @ 2018-08-21 22:29:52


上一页 | 下一页