結果
| 問題 | No.1604 Swap Sort:ONE |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-16 21:35:14 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 43 ms / 2,000 ms |
| コード長 | 177 bytes |
| 記録 | |
| コンパイル時間 | 232 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 80,516 KB |
| 最終ジャッジ日時 | 2026-03-27 20:14:00 |
| 合計ジャッジ時間 | 1,901 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
N = int(input())
P = [int(i) for i in input().split()]
total = 0
for i in range(N, 0, -1):
ind = P.index(i)
total += i - ind - 1
P = P[:ind] + P[ind+1:]
print(total)