結果
問題 |
No.482 あなたの名は
|
ユーザー |
|
提出日時 | 2017-02-13 02:14:52 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 172 bytes |
コンパイル時間 | 436 ms |
コンパイル使用メモリ | 19,840 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 17:12:59 |
合計ジャッジ時間 | 1,947 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 3 |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | k,c,n,d[1<<18],u[1<<18];f(v){u[v]?k-=c-1:f(d[v],u[v]=++c);}main(i){for(scanf("%d%d",&n,&k);~scanf("%d",d+i++););for(i=0;i++<n;c=0)!u[i]&&f(i);n=!puts(k<0||k%2?"NO":"YES");} | ^ main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘k’ [-Wimplicit-int] main.c:1:3: warning: type defaults to ‘int’ in declaration of ‘c’ [-Wimplicit-int] 1 | k,c,n,d[1<<18],u[1<<18];f(v){u[v]?k-=c-1:f(d[v],u[v]=++c);}main(i){for(scanf("%d%d",&n,&k);~scanf("%d",d+i++););for(i=0;i++<n;c=0)!u[i]&&f(i);n=!puts(k<0||k%2?"NO":"YES");} | ^ main.c:1:5: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int] 1 | k,c,n,d[1<<18],u[1<<18];f(v){u[v]?k-=c-1:f(d[v],u[v]=++c);}main(i){for(scanf("%d%d",&n,&k);~scanf("%d",d+i++););for(i=0;i++<n;c=0)!u[i]&&f(i);n=!puts(k<0||k%2?"NO":"YES");} | ^ main.c:1:7: warning: type defaults to ‘int’ in declaration of ‘d’ [-Wimplicit-int] 1 | k,c,n,d[1<<18],u[1<<18];f(v){u[v]?k-=c-1:f(d[v],u[v]=++c);}main(i){for(scanf("%d%d",&n,&k);~scanf("%d",d+i++););for(i=0;i++<n;c=0)!u[i]&&f(i);n=!puts(k<0||k%2?"NO":"YES");} | ^ main.c:1:16: warning: type defaults to ‘int’ in declaration of ‘u’ [-Wimplicit-int] 1 | k,c,n,d[1<<18],u[1<<18];f(v){u[v]?k-=c-1:f(d[v],u[v]=++c);}main(i){for(scanf("%d%d",&n,&k);~scanf("%d",d+i++););for(i=0;i++<n;c=0)!u[i]&&f(i);n=!puts(k<0||k%2?"NO":"YES");} | ^ main.c:1:25: warning: return type defaults to ‘int’ [-Wimplicit-int] 1 | k,c,n,d[1<<18],u[1<<18];f(v){u[v]?k-=c-1:f(d[v],u[v]=++c);}main(i){for(scanf("%d%d",&n,&k);~scanf("%d",d+i++););for(i=0;i++<n;c=0)!u[i]&&f(i);n=!puts(k<0||k%2?"NO":"YES");} | ^ main.c: In function ‘f’: main.c:1:25: warning: type of ‘v’ defaults to ‘int’ [-Wimplicit-int] main.c: At top level: main.c:1:60: warning: return type defaults to ‘int’ [-Wimplicit-int] 1 |
ソースコード
k,c,n,d[1<<18],u[1<<18];f(v){u[v]?k-=c-1:f(d[v],u[v]=++c);}main(i){for(scanf("%d%d",&n,&k);~scanf("%d",d+i++););for(i=0;i++<n;c=0)!u[i]&&f(i);n=!puts(k<0||k%2?"NO":"YES");}