結果

問題 No.397 NO MORE KADOMATSU
ユーザー matsu7874matsu7874
提出日時 2016-07-15 22:36:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 24,820 KB
平均クエリ数 651.67
最終ジャッジ日時 2023-09-24 00:12:35
合計ジャッジ時間 2,062 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
24,240 KB
testcase_01 AC 40 ms
24,324 KB
testcase_02 AC 39 ms
23,580 KB
testcase_03 AC 38 ms
23,572 KB
testcase_04 AC 40 ms
23,672 KB
testcase_05 AC 39 ms
23,688 KB
testcase_06 AC 39 ms
23,652 KB
testcase_07 AC 39 ms
23,364 KB
testcase_08 AC 37 ms
23,484 KB
testcase_09 AC 39 ms
24,384 KB
testcase_10 AC 63 ms
24,820 KB
testcase_11 AC 38 ms
23,808 KB
testcase_12 AC 38 ms
24,336 KB
testcase_13 AC 47 ms
24,448 KB
testcase_14 AC 48 ms
24,432 KB
testcase_15 AC 49 ms
24,236 KB
testcase_16 AC 37 ms
23,712 KB
testcase_17 AC 38 ms
24,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
n=int(input())
a=list(map(int, input().split()))
q = []
for i in range(n-1):
    for j in range(i+1,n):
        if a[i]>a[j]:
            a[i],a[j] = a[j],a[i]
            q.append((i,j))
print(len(q))
for u,v in q:
    print(u,v)

sys.stdout.flush()
dummy = input()
0