Submission #60163
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include<stdio.h> signed main(){ int N, i, j, box, now; scanf ( "%d" , &N); int a[101]; for (i=0; i<N; i++){ scanf ( "%d" , &a[i]); } for (i=0; i<N; i++){ now = i; for (j=i+1; j<N; j++){ if (a[j] > a[now]){ now=j; } } if (now != i){ box = a[i]; a[i] = a[now]; a[now] = box; } } for (i=0; i<N; i++){ printf ( "%d\n" , a[i]); } } |
ステータス
項目 | データ |
---|---|
問題 | 0930 - 背の順 |
ユーザー名 | ei2030 |
投稿日時 | 2020-06-23 16:20:45 |
言語 | C |
状態 | Accepted |
得点 | 1 |
ソースコード長 | 485 Byte |
最大実行時間 | 23 ms |
最大メモリ使用量 | 436 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 1 / 1 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
rnd_1.txt | AC | 23 ms | 376 KB |
1
|
rnd_2.txt | AC | 20 ms | 436 KB |
1
|
rnd_3.txt | AC | 17 ms | 360 KB |
1
|
rnd_4.txt | AC | 22 ms | 376 KB |
1
|
rnd_5.txt | AC | 22 ms | 428 KB |
1
|
sample.txt | AC | 19 ms | 348 KB |
1
|