結果

問題 No.439 チワワのなる木
ユーザー tailstails
提出日時 2017-01-31 12:10:44
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 329 bytes
コンパイル時間 1,204 ms
コンパイル使用メモリ 23,436 KB
実行使用メモリ 10,220 KB
最終ジャッジ日時 2023-08-25 13:57:17
合計ジャッジ時間 1,536 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 0 ms
4,376 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 0 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 0 ms
4,376 KB
testcase_09 AC 0 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 0 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 0 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 17 ms
4,380 KB
testcase_19 AC 15 ms
4,380 KB
testcase_20 AC 22 ms
4,376 KB
testcase_21 AC 6 ms
4,380 KB
testcase_22 AC 6 ms
4,380 KB
testcase_23 AC 24 ms
4,380 KB
testcase_24 AC 28 ms
8,968 KB
testcase_25 AC 20 ms
4,380 KB
testcase_26 AC 20 ms
4,376 KB
testcase_27 AC 24 ms
10,220 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:8: warning: data definition has no type or storage class
 long r;j,n,u,v,x,y;char*q;s[200020];typeof(s)t,g,h;d(p,o,z,i){int w=z=q[o-1]!=99,c=!z,l=t[o];for(;i=h[l];l=g[l])if(i-p)d(o,i),r+=z*u*(y+~v),c+=u,w+=v;r+=!!p*z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++j]=t[a];h[t[a]=j]=b;}main(a,b){for(scanf("%d%s",&n,q=s);*q++-99?++y:++x,~scanf("%d%d",&a,&b);f(b,a))f(a,b);q=s;d(0,1);r=!printf("%ld",r);}
        ^
main.c:1:8: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int]
main.c:1:10: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int]
 long r;j,n,u,v,x,y;char*q;s[200020];typeof(s)t,g,h;d(p,o,z,i){int w=z=q[o-1]!=99,c=!z,l=t[o];for(;i=h[l];l=g[l])if(i-p)d(o,i),r+=z*u*(y+~v),c+=u,w+=v;r+=!!p*z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++j]=t[a];h[t[a]=j]=b;}main(a,b){for(scanf("%d%s",&n,q=s);*q++-99?++y:++x,~scanf("%d%d",&a,&b);f(b,a))f(a,b);q=s;d(0,1);r=!printf("%ld",r);}
          ^
main.c:1:12: warning: type defaults to ‘int’ in declaration of ‘u’ [-Wimplicit-int]
 long r;j,n,u,v,x,y;char*q;s[200020];typeof(s)t,g,h;d(p,o,z,i){int w=z=q[o-1]!=99,c=!z,l=t[o];for(;i=h[l];l=g[l])if(i-p)d(o,i),r+=z*u*(y+~v),c+=u,w+=v;r+=!!p*z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++j]=t[a];h[t[a]=j]=b;}main(a,b){for(scanf("%d%s",&n,q=s);*q++-99?++y:++x,~scanf("%d%d",&a,&b);f(b,a))f(a,b);q=s;d(0,1);r=!printf("%ld",r);}
            ^
main.c:1:14: warning: type defaults to ‘int’ in declaration of ‘v’ [-Wimplicit-int]
 long r;j,n,u,v,x,y;char*q;s[200020];typeof(s)t,g,h;d(p,o,z,i){int w=z=q[o-1]!=99,c=!z,l=t[o];for(;i=h[l];l=g[l])if(i-p)d(o,i),r+=z*u*(y+~v),c+=u,w+=v;r+=!!p*z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++j]=t[a];h[t[a]=j]=b;}main(a,b){for(scanf("%d%s",&n,q=s);*q++-99?++y:++x,~scanf("%d%d",&a,&b);f(b,a))f(a,b);q=s;d(0,1);r=!printf("%ld",r);}
              ^
main.c:1:16: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int]
 long r;j,n,u,v,x,y;char*q;s[200020];typeof(s)t,g,h;d(p,o,z,i){int w=z=q[o-1]!=99,c=!z,l=t[o];for(;

ソースコード

diff #

long r;j,n,u,v,x,y;char*q;s[200020];typeof(s)t,g,h;d(p,o,z,i){int w=z=q[o-1]!=99,c=!z,l=t[o];for(;i=h[l];l=g[l])if(i-p)d(o,i),r+=z*u*(y+~v),c+=u,w+=v;r+=!!p*z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++j]=t[a];h[t[a]=j]=b;}main(a,b){for(scanf("%d%s",&n,q=s);*q++-99?++y:++x,~scanf("%d%d",&a,&b);f(b,a))f(a,b);q=s;d(0,1);r=!printf("%ld",r);}
0