結果
| 問題 |
No.490 yukiソート
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-12 18:31:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 449 bytes |
| コンパイル時間 | 173 ms |
| コンパイル使用メモリ | 82,020 KB |
| 実行使用メモリ | 60,940 KB |
| 最終ジャッジ日時 | 2024-06-30 00:33:11 |
| 合計ジャッジ時間 | 2,641 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 WA * 20 |
ソースコード
n=int(input())
a=list(map(int,input().split()))
if n > 4:
print(' '.join(map(str,sorted(a))))
exit(0)
while True:
ok = False
for i in range(1, 2*n-3):
for p in range(0, n-1):
q = i-p
if p >= q or not (0 <= p < n and 0 <= q < n):
continue
if a[p] > a[q]:
a[p],a[q]=a[q],a[p]
ok = True
if not ok:
break
print(' '.join(map(str,a)))