結果
問題 | No.490 yukiソート |
ユーザー | %20 |
提出日時 | 2017-03-10 23:19:21 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 263 bytes |
コンパイル時間 | 302 ms |
コンパイル使用メモリ | 29,440 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-24 10:24:24 |
合計ジャッジ時間 | 1,287 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,812 KB |
testcase_01 | WA | - |
testcase_02 | AC | 1 ms
6,944 KB |
testcase_03 | AC | 1 ms
6,944 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
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 | WA | - |
testcase_25 | AC | 1 ms
6,944 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
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 | t,p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:1: warning: type defaults to 'int' in declaration of 't' [-Wimplicit-int] main.c:1:3: warning: type defaults to 'int' in declaration of 'p' [-Wimplicit-int] 1 | t,p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:5: warning: type defaults to 'int' in declaration of 'q' [-Wimplicit-int] 1 | t,p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:7: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | t,p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:9: warning: type defaults to 'int' in declaration of 'l' [-Wimplicit-int] 1 | t,p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:11: warning: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] 1 | t,p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:13: warning: data definition has no type or storage class 1 | t,p,q,i,l,r;a[5000];main(n){ | ^ main.c:1:13: warning: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:21: warning: return type defaults to 'int' [-Wimplicit-int] 1 | t,p,q,i,l,r;a[5000];main(n){ | ^~~~ main.c: In function 'main': main.c:1:21: 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 | t,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:15:25: warning: implicit declaration of function 'printf' [-Wimplicit-functi
ソースコード
t,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]){ t=a[p]; a[p]=a[q]; a[q]^t; } } } for(i=0;i<n;++i)printf("%d ",a[i]); }