結果
| 問題 | No.1604 Swap Sort:ONE |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-16 21:31:26 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 232 bytes |
| 記録 | |
| コンパイル時間 | 166 ms |
| コンパイル使用メモリ | 85,024 KB |
| 実行使用メモリ | 77,592 KB |
| 最終ジャッジ日時 | 2026-03-27 20:06:49 |
| 合計ジャッジ時間 | 3,759 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 TLE * 1 -- * 20 |
ソースコード
n = int(input())
p = list(map(int, input().split()))
ans = 0
while True:
if p == sorted(p): break
for i in range(1, n):
a, b = p.index(i), p.index(i + 1)
if a > b: p[a], p[b] = p[b], p[a]; ans += 1
print(ans)