結果
問題 | No.397 NO MORE KADOMATSU |
ユーザー |
![]() |
提出日時 | 2024-12-30 14:12:09 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 125 ms / 2,000 ms |
コード長 | 289 bytes |
コンパイル時間 | 344 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 88,672 KB |
平均クエリ数 | 936.56 |
最終ジャッジ日時 | 2024-12-30 14:12:15 |
合計ジャッジ時間 | 3,634 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 |
ソースコード
N = int(input()) A = list(map(int,input().split())) ans = [] while A: x = A.index(max(A)) while x + 1 < len(A): if A[x] != A[x+1]: A[x],A[x+1] = A[x+1],A[x] ans.append((x,x+1)) x += 1 A.pop() print(len(ans)) for a in ans: print(*a)