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