結果

問題 No.397 NO MORE KADOMATSU
ユーザー convexineqconvexineq
提出日時 2021-02-17 08:38:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 92,856 KB
平均クエリ数 936.56
最終ジャッジ日時 2023-09-24 02:51:48
合計ジャッジ時間 3,327 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
87,044 KB
testcase_01 AC 86 ms
87,392 KB
testcase_02 AC 91 ms
87,020 KB
testcase_03 AC 107 ms
91,408 KB
testcase_04 AC 93 ms
87,412 KB
testcase_05 AC 96 ms
91,596 KB
testcase_06 AC 103 ms
92,440 KB
testcase_07 AC 99 ms
92,340 KB
testcase_08 AC 84 ms
87,440 KB
testcase_09 AC 86 ms
91,604 KB
testcase_10 AC 118 ms
92,564 KB
testcase_11 AC 85 ms
91,376 KB
testcase_12 AC 108 ms
92,312 KB
testcase_13 AC 110 ms
92,404 KB
testcase_14 AC 108 ms
92,852 KB
testcase_15 AC 109 ms
92,856 KB
testcase_16 AC 82 ms
87,408 KB
testcase_17 AC 85 ms
87,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
res = []
for i in range(n):
    for j in range(n-i-1):
        if a[j] > a[j+1]:
            res.append((j,j+1))
            a[j+1],a[j] = a[j],a[j+1]
print(len(res))
for x,y in res:
    print(x,y)
import sys
sys.stdout.flush()
input()
0