結果
| 問題 |
No.1604 Swap Sort:ONE
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-16 21:35:14 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 63 ms / 2,000 ms |
| コード長 | 177 bytes |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 76,160 KB |
| 最終ジャッジ日時 | 2024-07-06 08:32:09 |
| 合計ジャッジ時間 | 2,316 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)