Submission #35593
ソースコード
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 31 | //挿入ソート #include <stdio.h> int main() { int n; int data[105]; int i, j; scanf ( "%d" , &n); for ( i = 0; i < n; i++) { scanf ( "%d" , &data[i]); } for ( i = 1; i < n; i++) { int v = data[i]; j = i - 1; while ( j >= 0 && data[j] < v ) { data[j + 1] = data[j]; j--; } data[j + 1] = v; } for ( i = 0; i < n; i++) { printf ( "%d\n" , data[i]); } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0930 - 背の順 |
ユーザー名 | ei1710 |
投稿日時 | 2018-05-12 23:47:14 |
言語 | C |
状態 | Accepted |
得点 | 1 |
ソースコード長 | 520 Byte |
最大実行時間 | 30 ms |
最大メモリ使用量 | 496 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 1 / 1 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
rnd_1.txt | AC | 23 ms | 380 KB |
1
|
rnd_2.txt | AC | 30 ms | 404 KB |
1
|
rnd_3.txt | AC | 19 ms | 356 KB |
1
|
rnd_4.txt | AC | 19 ms | 384 KB |
1
|
rnd_5.txt | AC | 21 ms | 440 KB |
1
|
sample.txt | AC | 20 ms | 496 KB |
1
|