結果
問題 | No.397 NO MORE KADOMATSU |
ユーザー | 👑 testestest |
提出日時 | 2016-07-16 00:25:57 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 269 bytes |
コンパイル時間 | 187 ms |
コンパイル使用メモリ | 19,968 KB |
実行使用メモリ | 25,556 KB |
平均クエリ数 | 936.56 |
最終ジャッジ日時 | 2024-07-17 00:09:35 |
合計ジャッジ時間 | 1,956 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 29 ms
24,964 KB |
testcase_01 | AC | 27 ms
24,836 KB |
testcase_02 | AC | 24 ms
24,836 KB |
testcase_03 | AC | 25 ms
25,220 KB |
testcase_04 | AC | 23 ms
25,220 KB |
testcase_05 | AC | 25 ms
25,220 KB |
testcase_06 | AC | 29 ms
24,580 KB |
testcase_07 | AC | 28 ms
24,836 KB |
testcase_08 | AC | 24 ms
24,580 KB |
testcase_09 | AC | 24 ms
25,556 KB |
testcase_10 | AC | 51 ms
25,220 KB |
testcase_11 | AC | 24 ms
24,836 KB |
testcase_12 | AC | 31 ms
24,836 KB |
testcase_13 | AC | 34 ms
24,964 KB |
testcase_14 | AC | 37 ms
24,836 KB |
testcase_15 | AC | 35 ms
24,836 KB |
testcase_16 | AC | 24 ms
24,568 KB |
testcase_17 | AC | 24 ms
24,824 KB |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | i,j,s,t,a[110],b[20000]; | ^ main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] main.c:1:3: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int] 1 | i,j,s,t,a[110],b[20000]; | ^ main.c:1:5: warning: type defaults to ‘int’ in declaration of ‘s’ [-Wimplicit-int] 1 | i,j,s,t,a[110],b[20000]; | ^ main.c:1:7: warning: type defaults to ‘int’ in declaration of ‘t’ [-Wimplicit-int] 1 | i,j,s,t,a[110],b[20000]; | ^ main.c:1:9: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int] 1 | i,j,s,t,a[110],b[20000]; | ^ main.c:1:16: warning: type defaults to ‘int’ in declaration of ‘b’ [-Wimplicit-int] 1 | i,j,s,t,a[110],b[20000]; | ^ main.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 2 | main(n){ | ^~~~ main.c: In function ‘main’: main.c:2:1: warning: type of ‘n’ defaults to ‘int’ [-Wimplicit-int] main.c:3:13: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 3 | for(scanf("%d",&n);i<n;i++)scanf("%d",a+i); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | i,j,s,t,a[110],b[20000]; main.c:3:13: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 3 | for(scanf("%d",&n);i<n;i++)scanf("%d",a+i); | ^~~~~ main.c:3:13: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:8:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 8 | printf("%d\n",s); | ^~~~~~ main.c:8:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:8:9: warning: in
ソースコード
i,j,s,t,a[110],b[20000]; main(n){ for(scanf("%d",&n);i<n;i++)scanf("%d",a+i); for(;n--;)for(j=1;a[j];j++)if(a[j-1]>a[j]){ b[s++]=j; a[j]^=a[j-1]^=a[j]^=a[j-1]; } printf("%d\n",s); for(i=0;b[i];i++)fflush(!printf("%d %d\n",b[i]-1,b[i])); gets(&n); return 0; }