結果

問題 No.490 yukiソート
コンテスト
ユーザー cologne
提出日時 2025-12-02 16:15:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 438 bytes
記録
コンパイル時間 336 ms
コンパイル使用メモリ 82,112 KB
実行使用メモリ 68,916 KB
最終ジャッジ日時 2025-12-02 16:15:26
合計ジャッジ時間 4,465 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
from math import log


def input(): return sys.stdin.readline().rstrip('\n')


def main():
    n = int(input())
    *a, = map(int, input().split())
    for i in range(1, 2 * n - 3):
        for p in range(0, i + 1):
            q = i - p
            if not (0 <= p < q <= n - 1):
                continue
            if a[p] > a[q]:
                a[p], a[q] = a[q], a[p]
    print(*a)


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