結果
問題 | No.490 yukiソート |
ユーザー | %20 |
提出日時 | 2017-03-10 23:13:42 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 250 bytes |
コンパイル時間 | 265 ms |
コンパイル使用メモリ | 29,952 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-24 10:23:09 |
合計ジャッジ時間 | 1,240 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,812 KB |
testcase_01 | WA | - |
testcase_02 | AC | 1 ms
6,940 KB |
testcase_03 | AC | 1 ms
6,940 KB |
testcase_04 | AC | 1 ms
6,940 KB |
testcase_05 | AC | 1 ms
6,944 KB |
testcase_06 | AC | 1 ms
6,940 KB |
testcase_07 | AC | 1 ms
6,944 KB |
testcase_08 | AC | 1 ms
6,944 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | AC | 2 ms
6,944 KB |
testcase_25 | AC | 1 ms
6,944 KB |
testcase_26 | AC | 1 ms
6,940 KB |
testcase_27 | AC | 1 ms
6,940 KB |
testcase_28 | AC | 1 ms
6,944 KB |
testcase_29 | AC | 1 ms
6,944 KB |
testcase_30 | AC | 1 ms
6,944 KB |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:1: warning: type defaults to 'int' in declaration of 'p' [-Wimplicit-int] main.c:1:3: warning: type defaults to 'int' in declaration of 'q' [-Wimplicit-int] 1 | p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:5: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:7: warning: type defaults to 'int' in declaration of 'l' [-Wimplicit-int] 1 | p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:9: warning: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] 1 | p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:11: warning: data definition has no type or storage class 1 | p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:11: warning: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:19: warning: return type defaults to 'int' [-Wimplicit-int] 1 | p,q,i,l,r;a[5000];main(n){ | ^~~~ main.c: In function 'main': main.c:1:19: warning: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:2:13: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 2 | for(scanf("%d",&n);~scanf("%d",a+i++);); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | p,q,i,l,r;a[5000];main(n){ main.c:2:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 2 | for(scanf("%d",&n);~scanf("%d",a+i++);); | ^~~~~ main.c:2:13: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:13:25: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 13 | for(i=0;i<n;++i)printf("%d ",a[i]); | ^~~~~~ main.c:13:25: note: include '<stdio.h>' or provide a d
ソースコード
p,q,i,l,r;a[5000];main(n){ for(scanf("%d",&n);~scanf("%d",a+i++);); for(i=1;i<=2*n-3;++i){ l=i<n?0:i-n+1; r=i-1>>1; for(p=l;p<=r;++p){ q=i-p; if(a[p]>a[q]){ a[p]^=a[q]^=a[p]^=a[q]; } } } for(i=0;i<n;++i)printf("%d ",a[i]); }