結果
問題 | No.397 NO MORE KADOMATSU |
ユーザー | testestest |
提出日時 | 2016-07-15 22:36:49 |
言語 | C90 (gcc 11.4.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 303 bytes |
コンパイル時間 | 159 ms |
コンパイル使用メモリ | 20,608 KB |
実行使用メモリ | 39,888 KB |
最終ジャッジ日時 | 2024-07-17 00:03:23 |
合計ジャッジ時間 | 6,624 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,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,a[110],b[20000]; | ^ main.c:1:5: warning: type defaults to ‘int’ in declaration of ‘s’ [-Wimplicit-int] 1 | i,j,s,a[110],b[20000]; | ^ main.c:1:7: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int] 1 | i,j,s,a[110],b[20000]; | ^ main.c:1:14: warning: type defaults to ‘int’ in declaration of ‘b’ [-Wimplicit-int] 1 | i,j,s,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:9: 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,a[110],b[20000]; main.c:3:9: 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:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:10:5: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 10 | printf("%d\n",s/2); | ^~~~~~ main.c:10:5: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:10:5: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:10:5: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
ソースコード
i,j,s,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]); return 0; }