結果
問題 |
No.2289 順列ソート
|
ユーザー |
|
提出日時 | 2023-05-14 15:02:51 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 312 bytes |
コンパイル時間 | 213 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-30 03:29:29 |
合計ジャッジ時間 | 2,008 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
n = int(input()) a = list(map(int, input().split())) b = sorted(a) out = 0 for i in range(n): now1 = a[n - i - 1] now2 = b[n - i - 1] #print(now1, now2, a.index(now2)) if now1 == now2: pass else: a[a.index(now2)] = now1 a[n - i - 1] = now2 out += 1 print(out)