結果

問題 No.397 NO MORE KADOMATSU
ユーザー rlangevinrlangevin
提出日時 2023-01-14 01:12:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 86,812 KB
実行使用メモリ 93,084 KB
平均クエリ数 936.56
最終ジャッジ日時 2023-09-24 03:08:26
合計ジャッジ時間 3,607 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
87,376 KB
testcase_01 AC 93 ms
87,216 KB
testcase_02 AC 95 ms
87,476 KB
testcase_03 AC 103 ms
91,816 KB
testcase_04 AC 96 ms
86,944 KB
testcase_05 AC 101 ms
91,496 KB
testcase_06 AC 112 ms
92,136 KB
testcase_07 AC 112 ms
92,228 KB
testcase_08 AC 95 ms
87,652 KB
testcase_09 AC 99 ms
91,660 KB
testcase_10 AC 137 ms
93,084 KB
testcase_11 AC 98 ms
91,620 KB
testcase_12 AC 121 ms
92,592 KB
testcase_13 AC 124 ms
92,420 KB
testcase_14 AC 125 ms
92,976 KB
testcase_15 AC 126 ms
92,672 KB
testcase_16 AC 93 ms
87,436 KB
testcase_17 AC 93 ms
87,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys 

N = int(input())
A = list(map(int, input().split()))
ans = []
for i in range(N):
    for j in range(N - 1):
        if A[j] > A[j + 1]:
            A[j], A[j + 1] = A[j + 1], A[j]
            ans.append((j, j + 1))
print(len(ans))
for a, b in ans:
    print(a, b)
sys.stdout.flush()
input()
0