結果
問題 | No.482 あなたの名は |
ユーザー | testestest |
提出日時 | 2017-02-13 10:54:12 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 23 ms / 2,000 ms |
コード長 | 199 bytes |
コンパイル時間 | 83 ms |
コンパイル使用メモリ | 20,352 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-09 11:35:15 |
合計ジャッジ時間 | 1,376 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 0 ms
6,812 KB |
testcase_01 | AC | 0 ms
6,940 KB |
testcase_02 | AC | 1 ms
6,948 KB |
testcase_03 | AC | 1 ms
6,940 KB |
testcase_04 | AC | 0 ms
6,944 KB |
testcase_05 | AC | 0 ms
6,944 KB |
testcase_06 | AC | 0 ms
6,940 KB |
testcase_07 | AC | 1 ms
6,944 KB |
testcase_08 | AC | 0 ms
6,940 KB |
testcase_09 | AC | 1 ms
6,940 KB |
testcase_10 | AC | 0 ms
6,944 KB |
testcase_11 | AC | 0 ms
6,940 KB |
testcase_12 | AC | 1 ms
6,940 KB |
testcase_13 | AC | 0 ms
6,940 KB |
testcase_14 | AC | 1 ms
6,940 KB |
testcase_15 | AC | 22 ms
6,944 KB |
testcase_16 | AC | 22 ms
6,944 KB |
testcase_17 | AC | 23 ms
6,944 KB |
testcase_18 | AC | 23 ms
6,944 KB |
testcase_19 | AC | 22 ms
6,940 KB |
testcase_20 | AC | 22 ms
6,944 KB |
testcase_21 | AC | 23 ms
6,944 KB |
testcase_22 | AC | 23 ms
6,944 KB |
testcase_23 | AC | 23 ms
6,940 KB |
testcase_24 | AC | 22 ms
6,944 KB |
testcase_25 | AC | 22 ms
6,940 KB |
testcase_26 | AC | 22 ms
6,940 KB |
testcase_27 | AC | 22 ms
6,944 KB |
testcase_28 | AC | 22 ms
6,944 KB |
testcase_29 | AC | 21 ms
6,944 KB |
testcase_30 | AC | 0 ms
6,944 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++)while(a[j]!=j){ i=a[j]; a[j]=a[i]; a[i]=i; k--; } j=!puts(k&1?"NO":"YES"); }