結果

問題 No.397 NO MORE KADOMATSU
ユーザー NoNo
提出日時 2017-05-25 02:05:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 24,476 KB
平均クエリ数 651.67
最終ジャッジ日時 2023-09-24 01:16:55
合計ジャッジ時間 2,115 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
24,276 KB
testcase_01 AC 42 ms
23,988 KB
testcase_02 AC 39 ms
23,548 KB
testcase_03 AC 40 ms
23,444 KB
testcase_04 AC 38 ms
23,304 KB
testcase_05 AC 40 ms
23,396 KB
testcase_06 AC 40 ms
23,952 KB
testcase_07 AC 40 ms
23,520 KB
testcase_08 AC 39 ms
23,580 KB
testcase_09 AC 40 ms
23,772 KB
testcase_10 AC 62 ms
24,436 KB
testcase_11 AC 40 ms
23,988 KB
testcase_12 AC 40 ms
23,772 KB
testcase_13 AC 47 ms
24,476 KB
testcase_14 AC 49 ms
23,916 KB
testcase_15 AC 50 ms
24,212 KB
testcase_16 AC 39 ms
23,328 KB
testcase_17 AC 39 ms
23,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = input()
a = list(map(int,input().split()))
li = []
for i in range(len(a) - 1):
    for j in range(i + 1,len(a)):
        if a[i] > a[j]:
            li.append(str(i) + " " +str(j))
            w = a[i]
            a[i] = a[j]
            a[j] = w
print(len(li))
for i in li:
    print(i)
input()
0