結果

問題 No.397 NO MORE KADOMATSU
ユーザー vwxyzvwxyz
提出日時 2023-12-26 08:05:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 243 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 26,624 KB
平均クエリ数 651.67
最終ジャッジ日時 2023-12-26 08:05:19
合計ジャッジ時間 2,498 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
25,984 KB
testcase_01 AC 50 ms
25,984 KB
testcase_02 AC 53 ms
25,984 KB
testcase_03 AC 52 ms
25,984 KB
testcase_04 AC 56 ms
25,984 KB
testcase_05 AC 53 ms
25,984 KB
testcase_06 AC 54 ms
26,112 KB
testcase_07 AC 53 ms
26,112 KB
testcase_08 AC 52 ms
25,984 KB
testcase_09 AC 52 ms
25,984 KB
testcase_10 AC 80 ms
26,624 KB
testcase_11 AC 53 ms
25,984 KB
testcase_12 AC 54 ms
25,984 KB
testcase_13 AC 65 ms
26,368 KB
testcase_14 AC 63 ms
26,368 KB
testcase_15 AC 63 ms
26,368 KB
testcase_16 AC 52 ms
25,992 KB
testcase_17 AC 53 ms
25,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
ans_lst=[]
for j in range(N):
    for i in range(j):
        if A[i]>A[j]:
            A[i],A[j]=A[j],A[i]
            ans_lst.append((i,j))
print(len(ans_lst))
for i,j in ans_lst:
    print(i,j)
0