結果

問題 No.397 NO MORE KADOMATSU
ユーザー nebukuro09nebukuro09
提出日時 2016-10-19 12:36:45
言語 Python2
(2.7.18)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 6,716 KB
実行使用メモリ 24,336 KB
平均クエリ数 651.67
最終ジャッジ日時 2023-09-24 00:36:56
合計ジャッジ時間 2,224 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
23,496 KB
testcase_01 AC 36 ms
24,276 KB
testcase_02 AC 35 ms
23,580 KB
testcase_03 AC 38 ms
23,628 KB
testcase_04 AC 36 ms
23,340 KB
testcase_05 AC 36 ms
24,204 KB
testcase_06 AC 38 ms
23,508 KB
testcase_07 AC 38 ms
23,772 KB
testcase_08 AC 37 ms
23,604 KB
testcase_09 AC 37 ms
23,988 KB
testcase_10 AC 60 ms
23,592 KB
testcase_11 AC 36 ms
24,276 KB
testcase_12 AC 37 ms
23,784 KB
testcase_13 AC 45 ms
23,988 KB
testcase_14 AC 45 ms
24,336 KB
testcase_15 AC 47 ms
24,276 KB
testcase_16 AC 36 ms
24,264 KB
testcase_17 AC 37 ms
23,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

N = input()
A = map(int,raw_input().split())
ans = []
for i in xrange(N):
    for j in xrange(i+1, N):
        if A[i] > A[j]:
            A[i], A[j] = A[j], A[i]
            ans.append((i, j))
print len(ans)
for i, j in ans:
    print i, j
sys.stdout.flush()
raw_input()
0