結果
問題 | No.397 NO MORE KADOMATSU |
ユーザー | 👑 testestest |
提出日時 | 2016-07-15 22:38:12 |
言語 | C90 (gcc 11.4.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 287 bytes |
コンパイル時間 | 270 ms |
コンパイル使用メモリ | 20,480 KB |
実行使用メモリ | 40,268 KB |
最終ジャッジ日時 | 2024-07-17 00:03:44 |
合計ジャッジ時間 | 6,575 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | TLE | - |
testcase_01 | -- | - |
testcase_02 | -- | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
コンパイルメッセージ
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);~scanf("%d",a+i);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);~scanf("%d",a+i);i++); | ^~~~~ main.c:3:13: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:10:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 10 | printf("%d\n",s/2); | ^~~~~~ main.c:10:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:10:9: warning: i
ソースコード
i,j,s,t,a[110],b[20000]; main(n){ for(scanf("%d",&n);~scanf("%d",a+i);i++); a[i-1]=0; for(;n--;)for(j=1;a[j];j++)if(a[j-1]>a[j]){ b[s++]=j-1; b[s++]=j; a[j-1]^=a[j]^=a[j-1]^=a[j]; } printf("%d\n",s/2); for(i=0;b[i];i+=2)printf("%d %d\n",b[i],b[i+1]); fflush(0); return 0; }