結果
問題 | No.482 あなたの名は |
ユーザー | 👑 testestest |
提出日時 | 2017-02-12 16:58:01 |
言語 | C90 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 196 bytes |
コンパイル時間 | 87 ms |
コンパイル使用メモリ | 20,608 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-09 10:04:02 |
合計ジャッジ時間 | 1,599 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 0 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 0 ms
5,376 KB |
testcase_05 | AC | 0 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | WA | - |
testcase_09 | AC | 0 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 0 ms
5,376 KB |
testcase_12 | WA | - |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 23 ms
5,376 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 21 ms
5,376 KB |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 21 ms
5,376 KB |
testcase_24 | AC | 22 ms
5,376 KB |
testcase_25 | AC | 25 ms
5,376 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 22 ms
5,376 KB |
testcase_29 | AC | 20 ms
5,376 KB |
testcase_30 | AC | 0 ms
5,376 KB |
コンパイルメッセージ
main.c:1:17: warning: data definition has no type or storage class 1 | long a[1<<18],k;i,j,n; | ^ main.c:1:17: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] main.c:1:19: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int] 1 | long a[1<<18],k;i,j,n; | ^ main.c:1:21: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int] 1 | long a[1<<18],k;i,j,n; | ^ main.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function ‘main’: main.c:3:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 3 | scanf("%d%ld",&n,&k); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | long a[1<<18],k;i,j,n; main.c:3:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 3 | scanf("%d%ld",&n,&k); | ^~~~~ main.c:3:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:4:34: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long int *’ [-Wformat=] 4 | for(i=1;i<=n;i++)scanf("%d",a+i); | ~^ ~~~ | | | | | long int * | int * | %ld main.c:11:12: warning: implicit declaration of function ‘puts’ [-Wimplicit-function-declaration] 11 | j=!puts(k&1?"NO":"YES"); | ^~~~ main.c:11:12: note: include ‘<stdio.h>’ or provide a declaration of ‘puts’
ソースコード
long a[1<<18],k;i,j,n; main(){ scanf("%d%ld",&n,&k); for(i=1;i<=n;i++)scanf("%d",a+i); for(j=1;j<=n&&k>=0;j++)if(a[j]!=j){ i=a[j]; a[j]=a[i]; a[i]=i; k--; } j=!puts(k&1?"NO":"YES"); }