結果

問題 No.482 あなたの名は
ユーザー kotatsugame
提出日時 2017-02-13 02:24:36
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 172 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 20,480 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-29 20:40:24
合計ジャッジ時間 1,843 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:8: warning: data definition has no type or storage class
    1 | long k;c,n,d[1<<18],u[1<<18];f(v){u[v]?c--:f(d[v],u[v]=++c);}main(i){for(scanf("%d%ld",&n,&k);~scanf("%d",d+i++););for(--i;--i;)!u[i]&&f(i);n=!puts(k<c||k-c&1?"NO":"YES");}
      |        ^
main.c:1:8: warning: type defaults to ‘int’ in declaration of ‘c’ [-Wimplicit-int]
main.c:1:10: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int]
    1 | long k;c,n,d[1<<18],u[1<<18];f(v){u[v]?c--:f(d[v],u[v]=++c);}main(i){for(scanf("%d%ld",&n,&k);~scanf("%d",d+i++););for(--i;--i;)!u[i]&&f(i);n=!puts(k<c||k-c&1?"NO":"YES");}
      |          ^
main.c:1:12: warning: type defaults to ‘int’ in declaration of ‘d’ [-Wimplicit-int]
    1 | long k;c,n,d[1<<18],u[1<<18];f(v){u[v]?c--:f(d[v],u[v]=++c);}main(i){for(scanf("%d%ld",&n,&k);~scanf("%d",d+i++););for(--i;--i;)!u[i]&&f(i);n=!puts(k<c||k-c&1?"NO":"YES");}
      |            ^
main.c:1:21: warning: type defaults to ‘int’ in declaration of ‘u’ [-Wimplicit-int]
    1 | long k;c,n,d[1<<18],u[1<<18];f(v){u[v]?c--:f(d[v],u[v]=++c);}main(i){for(scanf("%d%ld",&n,&k);~scanf("%d",d+i++););for(--i;--i;)!u[i]&&f(i);n=!puts(k<c||k-c&1?"NO":"YES");}
      |                     ^
main.c:1:30: warning: return type defaults to ‘int’ [-Wimplicit-int]
    1 | long k;c,n,d[1<<18],u[1<<18];f(v){u[v]?c--:f(d[v],u[v]=++c);}main(i){for(scanf("%d%ld",&n,&k);~scanf("%d",d+i++););for(--i;--i;)!u[i]&&f(i);n=!puts(k<c||k-c&1?"NO":"YES");}
      |                              ^
main.c: In function ‘f’:
main.c:1:30: warning: type of ‘v’ defaults to ‘int’ [-Wimplicit-int]
main.c: At top level:
main.c:1:62: warning: return type defaults to ‘int’ [-Wimplicit-int]
    1 | long k;c,n,d[1<<18],u[1<<18];f(v){u[v]?c--:f(d[v],u[v]=++c);}main(i){for(scanf("%d%ld",&n,&k);~scanf("%d",d+i++););for(--i;--i;)!u[i]&&f(i);n=!puts(k<c||k-c&1?"NO":"YES");}
      |                                                              ^~~~
main.c:

ソースコード

diff #

long k;c,n,d[1<<18],u[1<<18];f(v){u[v]?c--:f(d[v],u[v]=++c);}main(i){for(scanf("%d%ld",&n,&k);~scanf("%d",d+i++););for(--i;--i;)!u[i]&&f(i);n=!puts(k<c||k-c&1?"NO":"YES");}
0