結果

問題 No.490 yukiソート
ユーザー yomo3yomo3
提出日時 2020-02-19 22:01:25
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 730 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-10-08 18:20:00
合計ジャッジ時間 9,367 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

for i in range(1, 2 * N - 3):
    p_max = (i - 1) // 2
    p_min = max(0, i - N + 1)
    for p in range(p_min, p_max + 1):
        q = i - p
        if A[p] > A[q]:
            A[p], A[q] = A[q], A[p]
print(*A)
0