結果

問題 No.397 NO MORE KADOMATSU
ユーザー kotatsugamekotatsugame
提出日時 2017-08-11 21:42:00
言語 C
(gcc 12.3.0)
結果
RE  
実行時間 -
コード長 256 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 29,440 KB
実行使用メモリ 25,348 KB
平均クエリ数 141.44
最終ジャッジ日時 2024-07-16 13:59:57
合計ジャッジ時間 4,170 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
24,964 KB
testcase_01 AC 23 ms
25,220 KB
testcase_02 AC 23 ms
25,220 KB
testcase_03 AC 24 ms
25,220 KB
testcase_04 AC 23 ms
25,220 KB
testcase_05 AC 24 ms
24,836 KB
testcase_06 AC 24 ms
24,580 KB
testcase_07 AC 26 ms
24,836 KB
testcase_08 AC 23 ms
24,580 KB
testcase_09 AC 23 ms
25,220 KB
testcase_10 RE -
testcase_11 AC 23 ms
25,220 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 22 ms
24,824 KB
testcase_17 AC 22 ms
24,568 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | s[101];i,j;a[999][2];c;
      | ^
main.c:1:1: warning: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:8: warning: data definition has no type or storage class
    1 | s[101];i,j;a[999][2];c;
      |        ^
main.c:1:8: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
main.c:1:10: warning: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
    1 | s[101];i,j;a[999][2];c;
      |          ^
main.c:1:12: warning: data definition has no type or storage class
    1 | s[101];i,j;a[999][2];c;
      |            ^
main.c:1:12: warning: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:22: warning: data definition has no type or storage class
    1 | s[101];i,j;a[999][2];c;
      |                      ^
main.c:1:22: warning: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
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);j<n;)scanf("%d",s+j++);
      |             ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | s[101];i,j;a[999][2];c;
main.c:3:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |         for(scanf("%d",&n);j<n;)scanf("%d",s+j++);
      |             ^~~~~
main.c:3:13: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:13: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    5 |         for(printf("%d\n",c),i=0;i<c;i++)printf("%d %d\n",*a[i],a[i][1]);
      |             ^~~~~~
main.c:5:13: note: include '<stdio.h>' or provide a declaration 

ソースコード

diff #

s[101];i,j;a[999][2];c;
main(n){
	for(scanf("%d",&n);j<n;)scanf("%d",s+j++);
	for(;i<n;i++)for(j=i;j--;)s[j]>s[j+1]&&(*a[c]=j,a[c++][1]=j+1,s[j+1]^=s[j]^=s[j+1]^=s[j]);
	for(printf("%d\n",c),i=0;i<c;i++)printf("%d %d\n",*a[i],a[i][1]);
	fflush(!gets(s));
}
0