結果

問題 No.397 NO MORE KADOMATSU
ユーザー mkawa2mkawa2
提出日時 2020-07-08 23:14:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 294 bytes
コンパイル時間 777 ms
コンパイル使用メモリ 10,896 KB
実行使用メモリ 24,360 KB
平均クエリ数 39.44
最終ジャッジ日時 2023-09-24 03:48:40
合計ジャッジ時間 3,526 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
23,492 KB
testcase_01 AC 39 ms
23,520 KB
testcase_02 AC 39 ms
23,728 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 40 ms
23,712 KB
testcase_08 AC 39 ms
23,448 KB
testcase_09 AC 39 ms
24,288 KB
testcase_10 AC 40 ms
23,532 KB
testcase_11 AC 39 ms
23,892 KB
testcase_12 AC 41 ms
23,580 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 42 ms
23,592 KB
testcase_16 AC 38 ms
23,616 KB
testcase_17 AC 38 ms
24,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
ai=[[a,i] for i,a in enumerate(map(int,input().split()))]
ai.sort()
ans=[]
for j in range(n):
    while 1:
        j,k=ai[j][1],j
        ai[k][1]=-1
        if ai[j][1] == -1:break
        ans.append((j,k))
print(len(ans),flush=True)
for j,k in ans:print(j,k,flush=True)
input()
0