結果
問題 | No.439 チワワのなる木 |
ユーザー |
![]() |
提出日時 | 2017-01-31 13:48:45 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 29 ms / 5,000 ms |
コード長 | 317 bytes |
コンパイル時間 | 354 ms |
コンパイル使用メモリ | 20,352 KB |
実行使用メモリ | 11,392 KB |
最終ジャッジ日時 | 2024-12-23 22:28:54 |
合計ジャッジ時間 | 1,439 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
コンパイルメッセージ
main.c:1:8: warning: data definition has no type or storage class 1 | long r;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+=z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++u]=t[a];h[t[a]=u]=b;}main(u){for(scanf("%*d%s",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] 1 | long r;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+=z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++u]=t[a];h[t[a]=u]=b;}main(u){for(scanf("%*d%s",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] 1 | long r;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+=z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++u]=t[a];h[t[a]=u]=b;}main(u){for(scanf("%*d%s",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] 1 | long r;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+=z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++u]=t[a];h[t[a]=u]=b;}main(u){for(scanf("%*d%s",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 1 | long r;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])
ソースコード
long r;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+=z*(x-c)*(w-1);u=c;v=w;}f(a,b){g[++u]=t[a];h[t[a]=u]=b;}main(u){for(scanf("%*d%s",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);}