結果
問題 | No.397 NO MORE KADOMATSU |
ユーザー |
|
提出日時 | 2016-07-16 09:54:20 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 62 ms / 2,000 ms |
コード長 | 401 bytes |
コンパイル時間 | 230 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 27,608 KB |
平均クエリ数 | 36.83 |
最終ジャッジ日時 | 2024-07-17 00:10:35 |
合計ジャッジ時間 | 2,471 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 |
ソースコード
#!/usr/bin/python3 nya = lambda msg: print(msg, flush=True) n = int(input()) a = list(map(int, input().split())) b = sorted(a) arr = [] for i in range(n): if a[i] == b[i]: continue for j in range(i+1, n): if a[j] == b[i]: arr.append((i, j)) a[i], a[j] = a[j], a[i] break m = len(arr) nya(m) for x, y in arr: nya('{} {}'.format(x, y))