結果

問題 No.490 yukiソート
ユーザー 👑 rin204rin204
提出日時 2021-08-29 15:50:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 378 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 165,876 KB
最終ジャッジ日時 2023-08-14 10:11:24
合計ジャッジ時間 7,655 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,532 KB
testcase_01 AC 70 ms
71,296 KB
testcase_02 AC 70 ms
71,220 KB
testcase_03 AC 71 ms
71,176 KB
testcase_04 AC 95 ms
76,532 KB
testcase_05 AC 83 ms
76,560 KB
testcase_06 AC 82 ms
76,692 KB
testcase_07 AC 84 ms
76,564 KB
testcase_08 AC 83 ms
76,220 KB
testcase_09 AC 82 ms
76,500 KB
testcase_10 AC 83 ms
76,556 KB
testcase_11 AC 82 ms
76,216 KB
testcase_12 AC 84 ms
76,640 KB
testcase_13 AC 84 ms
76,328 KB
testcase_14 AC 375 ms
165,500 KB
testcase_15 AC 372 ms
165,468 KB
testcase_16 AC 371 ms
165,608 KB
testcase_17 AC 371 ms
165,524 KB
testcase_18 AC 377 ms
165,876 KB
testcase_19 AC 377 ms
165,352 KB
testcase_20 AC 376 ms
165,552 KB
testcase_21 AC 372 ms
165,684 KB
testcase_22 AC 375 ms
165,784 KB
testcase_23 AC 378 ms
165,508 KB
testcase_24 AC 71 ms
71,216 KB
testcase_25 AC 69 ms
71,176 KB
testcase_26 AC 70 ms
71,376 KB
testcase_27 AC 70 ms
71,376 KB
testcase_28 AC 70 ms
71,408 KB
testcase_29 AC 70 ms
71,308 KB
testcase_30 AC 71 ms
71,036 KB
testcase_31 AC 70 ms
71,472 KB
testcase_32 AC 69 ms
71,224 KB
testcase_33 AC 71 ms
71,404 KB
testcase_34 AC 69 ms
71,340 KB
testcase_35 AC 70 ms
71,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
alst = list(map(int, input().split()))

q = [[] for _ in range(2 * n - 3)]

for i in range(n):
    for j in range(i + 1, n):
        if i + j < 2 * n - 3:
            q[i + j].append((i, j))
        
for lst in q:
    for a, b in lst:
        if alst[a] > alst[b]:
            alst[a], alst[b] = alst[b], alst[a]
print(*alst)
    
0