結果

問題 No.397 NO MORE KADOMATSU
ユーザー 👑 rin204rin204
提出日時 2022-01-20 03:08:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 92,932 KB
平均クエリ数 936.56
最終ジャッジ日時 2023-09-24 03:02:02
合計ジャッジ時間 3,727 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
87,248 KB
testcase_01 AC 96 ms
86,964 KB
testcase_02 AC 97 ms
87,280 KB
testcase_03 AC 105 ms
91,828 KB
testcase_04 AC 99 ms
87,352 KB
testcase_05 AC 107 ms
91,764 KB
testcase_06 AC 116 ms
92,932 KB
testcase_07 AC 116 ms
92,744 KB
testcase_08 AC 98 ms
87,468 KB
testcase_09 AC 101 ms
91,896 KB
testcase_10 AC 132 ms
92,516 KB
testcase_11 AC 100 ms
91,428 KB
testcase_12 AC 123 ms
92,888 KB
testcase_13 AC 129 ms
92,608 KB
testcase_14 AC 131 ms
92,884 KB
testcase_15 AC 127 ms
92,820 KB
testcase_16 AC 99 ms
87,196 KB
testcase_17 AC 99 ms
87,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
ans = []
for i in range(n):
    for j in range(n - 1, i, -1):
        if A[j] < A[j - 1]:
            A[j - 1], A[j] = A[j], A[j - 1]
            ans.append((j - 1, j))

print(len(ans))
for row in ans:
    print(*row)
print(end="", flush = True)

input()
0