結果

問題 No.439 チワワのなる木
ユーザー tailstails
提出日時 2017-01-31 12:10:44
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 329 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 20,608 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-12-23 22:17:55
合計ジャッジ時間 1,560 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:8: warning: data definition has no type or storage class
    1 | 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]
    1 | 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]
    1 | 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]
    1 | 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]
    1 | long r;j,n,u,v,x,y;char*q;s[200020]

ソースコード

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