結果
問題 | No.490 yukiソート |
ユーザー | %20 |
提出日時 | 2017-03-10 23:13:42 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 250 bytes |
コンパイル時間 | 1,289 ms |
コンパイル使用メモリ | 28,484 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-09-06 15:58:56 |
合計ジャッジ時間 | 1,583 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | WA | - |
testcase_02 | AC | 0 ms
4,376 KB |
testcase_03 | AC | 0 ms
4,376 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 1 ms
4,380 KB |
testcase_06 | AC | 1 ms
4,380 KB |
testcase_07 | AC | 1 ms
4,376 KB |
testcase_08 | AC | 1 ms
4,376 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 | 1 ms
4,376 KB |
testcase_25 | AC | 1 ms
4,376 KB |
testcase_26 | AC | 0 ms
4,376 KB |
testcase_27 | AC | 1 ms
4,380 KB |
testcase_28 | AC | 1 ms
4,376 KB |
testcase_29 | AC | 0 ms
4,380 KB |
testcase_30 | AC | 0 ms
4,380 KB |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
コンパイルメッセージ
main.c:1:1: 警告: データ定義が型または記憶域クラスを持っていません 1 | p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:1: 警告: 型がデフォルトの ‘int’ に ‘p’ の宣言内でなります [-Wimplicit-int] main.c:1:3: 警告: 型がデフォルトの ‘int’ に ‘q’ の宣言内でなります [-Wimplicit-int] 1 | p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:5: 警告: 型がデフォルトの ‘int’ に ‘i’ の宣言内でなります [-Wimplicit-int] 1 | p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:7: 警告: 型がデフォルトの ‘int’ に ‘l’ の宣言内でなります [-Wimplicit-int] 1 | p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:9: 警告: 型がデフォルトの ‘int’ に ‘r’ の宣言内でなります [-Wimplicit-int] 1 | p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:11: 警告: データ定義が型または記憶域クラスを持っていません 1 | p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:11: 警告: 型がデフォルトの ‘int’ に ‘a’ の宣言内でなります [-Wimplicit-int] main.c:1:19: 警告: 戻り値の型をデフォルトの ‘int’ にします [-Wimplicit-int] 1 | p,q,i,l,r;a[5000];main(n){ | ^~~~ main.c: 関数 ‘main’ 内: main.c:1:19: 警告: ‘n’ の型をデフォルトの ‘int’ にします [-Wimplicit-int] main.c:2:13: 警告: 関数 ‘scanf’ の暗黙的な宣言です [-Wimplicit-function-declaration] 2 | for(scanf("%d",&n);~scanf("%d",a+i++);); | ^~~~~ main.c:1:1: 備考: 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: 警告: 組み込み関数 ‘scanf’ の互換性がない暗黙的な宣言です [-Wbuiltin-declaration-mismatch] 2 | for(scanf("%d",&n);~scanf("%d",a+i++);); | ^~~~~ mai
ソースコード
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]); }