結果

問題 No.490 yukiソート
ユーザー はむ吉🐹はむ吉🐹
提出日時 2017-03-10 22:28:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 403 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 76,936 KB
最終ジャッジ日時 2023-09-06 15:33:04
合計ジャッジ時間 5,197 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,308 KB
testcase_01 AC 71 ms
71,460 KB
testcase_02 AC 73 ms
71,352 KB
testcase_03 AC 72 ms
71,088 KB
testcase_04 AC 84 ms
76,156 KB
testcase_05 AC 84 ms
76,136 KB
testcase_06 AC 83 ms
75,888 KB
testcase_07 AC 81 ms
76,000 KB
testcase_08 AC 83 ms
75,952 KB
testcase_09 AC 83 ms
76,008 KB
testcase_10 AC 83 ms
76,312 KB
testcase_11 AC 84 ms
75,780 KB
testcase_12 AC 82 ms
76,144 KB
testcase_13 AC 86 ms
75,992 KB
testcase_14 AC 146 ms
76,692 KB
testcase_15 AC 144 ms
76,708 KB
testcase_16 AC 145 ms
76,704 KB
testcase_17 AC 146 ms
76,532 KB
testcase_18 AC 143 ms
76,684 KB
testcase_19 AC 146 ms
76,800 KB
testcase_20 AC 145 ms
76,936 KB
testcase_21 AC 146 ms
76,908 KB
testcase_22 AC 146 ms
76,680 KB
testcase_23 AC 143 ms
76,680 KB
testcase_24 AC 71 ms
71,224 KB
testcase_25 AC 72 ms
71,352 KB
testcase_26 AC 71 ms
71,344 KB
testcase_27 AC 71 ms
71,452 KB
testcase_28 AC 72 ms
71,500 KB
testcase_29 AC 73 ms
71,292 KB
testcase_30 AC 73 ms
71,380 KB
testcase_31 AC 72 ms
71,200 KB
testcase_32 AC 72 ms
71,224 KB
testcase_33 AC 71 ms
71,480 KB
testcase_34 AC 72 ms
71,172 KB
testcase_35 AC 72 ms
71,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env pypy3


def in_place_yuki_sort(xs):
    n = len(xs)
    for i in range(1, 2 * n - 3):
        for p in range(n):
            q = i - p
            if 0 <= p < q <= n - 1 and xs[p] > xs[q]:
                xs[p], xs[q] = xs[q], xs[p]


def main():
    _ = input()
    xs = [int(x) for x in input().split()]
    in_place_yuki_sort(xs)
    print(*xs)


if __name__ == '__main__':
    main()
0