結果
問題 |
No.397 NO MORE KADOMATSU
|
ユーザー |
|
提出日時 | 2016-07-15 22:45:41 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 83 ms / 2,000 ms |
コード長 | 330 bytes |
コンパイル時間 | 97 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 27,864 KB |
平均クエリ数 | 936.56 |
最終ジャッジ日時 | 2024-07-17 00:04:03 |
合計ジャッジ時間 | 2,525 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 |
ソースコード
#!/usr/bin/env python3 import sys n = int(input()) a = list(map(int,input().split())) ans = [] for i in range(n): for j in reversed(range(i)): if a[j] > a[j+1]: ans.append((j, j+1)) a[j], a[j+1] = a[j+1], a[j] print(len(ans)) for i, j in ans: print(i, j) sys.stdout.flush() dummy = input()