結果
| 問題 |
No.2289 順列ソート
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2023-05-05 21:38:15 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 2,000 ms |
| コード長 | 191 bytes |
| コンパイル時間 | 353 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 52,352 KB |
| 最終ジャッジ日時 | 2024-11-23 06:28:02 |
| 合計ジャッジ時間 | 2,154 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
N = int(input())
P = list(map(lambda x: int(x)-1, input().split()))
ans = 0
for i in range(N):
p = P.index(i)
if i != p:
P[i], P[p] = P[p], P[i]
ans += 1
print(ans)
norioc