結果

問題 No.439 チワワのなる木
ユーザー tailstails
提出日時 2017-01-31 19:22:06
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 312 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 24,068 KB
実行使用メモリ 11,288 KB
最終ジャッジ日時 2023-08-25 14:31:25
合計ジャッジ時間 1,846 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 0 ms
4,376 KB
testcase_07 AC 0 ms
4,384 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 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,736 KB
testcase_19 AC 15 ms
4,692 KB
testcase_20 AC 21 ms
5,008 KB
testcase_21 AC 7 ms
4,376 KB
testcase_22 AC 6 ms
4,376 KB
testcase_23 AC 23 ms
5,624 KB
testcase_24 AC 26 ms
10,288 KB
testcase_25 AC 18 ms
5,144 KB
testcase_26 AC 17 ms
5,060 KB
testcase_27 AC 23 ms
11,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:8: warning: data definition has no type or storage class
 long r;u,v,x,y;char*q;s[1<<18];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+=z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++u]=t[a];h[t[a]=u]=b;}main(u){for(gets(gets(q=s));*q++>99?++y:++x,~scanf("%d%d",&u,&v);f(v,u))f(u,v);q=s;d(0,1);r=!printf("%ld",r);}
        ^
main.c:1:8: warning: type defaults to ‘int’ in declaration of ‘u’ [-Wimplicit-int]
main.c:1:10: warning: type defaults to ‘int’ in declaration of ‘v’ [-Wimplicit-int]
 long r;u,v,x,y;char*q;s[1<<18];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+=z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++u]=t[a];h[t[a]=u]=b;}main(u){for(gets(gets(q=s));*q++>99?++y:++x,~scanf("%d%d",&u,&v);f(v,u))f(u,v);q=s;d(0,1);r=!printf("%ld",r);}
          ^
main.c:1:12: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int]
 long r;u,v,x,y;char*q;s[1<<18];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+=z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++u]=t[a];h[t[a]=u]=b;}main(u){for(gets(gets(q=s));*q++>99?++y:++x,~scanf("%d%d",&u,&v);f(v,u))f(u,v);q=s;d(0,1);r=!printf("%ld",r);}
            ^
main.c:1:14: warning: type defaults to ‘int’ in declaration of ‘y’ [-Wimplicit-int]
 long r;u,v,x,y;char*q;s[1<<18];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+=z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++u]=t[a];h[t[a]=u]=b;}main(u){for(gets(gets(q=s));*q++>99?++y:++x,~scanf("%d%d",&u,&v);f(v,u))f(u,v);q=s;d(0,1);r=!printf("%ld",r);}
              ^
main.c:1:23: warning: data definition has no type or storage class
 long r;u,v,x,y;char*q;s[1<<18];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+=z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++u]=t[a];h[

ソースコード

diff #

long r;u,v,x,y;char*q;s[1<<18];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+=z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++u]=t[a];h[t[a]=u]=b;}main(u){for(gets(gets(q=s));*q++>99?++y:++x,~scanf("%d%d",&u,&v);f(v,u))f(u,v);q=s;d(0,1);r=!printf("%ld",r);}
0