結果

問題 No.397 NO MORE KADOMATSU
ユーザー fumofumofunifumofumofuni
提出日時 2021-09-14 21:00:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 1,664 ms
コンパイル使用メモリ 86,860 KB
実行使用メモリ 92,756 KB
平均クエリ数 936.56
最終ジャッジ日時 2023-09-24 03:00:53
合計ジャッジ時間 4,594 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
86,768 KB
testcase_01 AC 86 ms
86,844 KB
testcase_02 AC 85 ms
87,060 KB
testcase_03 AC 103 ms
91,620 KB
testcase_04 AC 86 ms
87,288 KB
testcase_05 AC 96 ms
91,400 KB
testcase_06 AC 113 ms
92,112 KB
testcase_07 AC 105 ms
92,328 KB
testcase_08 AC 88 ms
86,944 KB
testcase_09 AC 87 ms
91,112 KB
testcase_10 AC 132 ms
92,756 KB
testcase_11 AC 90 ms
91,652 KB
testcase_12 AC 113 ms
92,388 KB
testcase_13 AC 118 ms
92,464 KB
testcase_14 AC 117 ms
92,008 KB
testcase_15 AC 115 ms
92,380 KB
testcase_16 AC 88 ms
86,612 KB
testcase_17 AC 88 ms
86,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
M=list(map(int,input().split()))
A=[]
B=[]
for i in range(N):
    for j in range(N-1):
        if M[j]>M[j+1]:
            A.append(j)
            B.append(j+1)
            M[j],M[j+1]=M[j+1],M[j]
print(len(A))
for i in range(len(A)):
    print(A[i],B[i],' ')
N=input()
0