結果

問題 No.397 NO MORE KADOMATSU
ユーザー titiatitia
提出日時 2023-02-20 00:47:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 24,276 KB
平均クエリ数 36.83
最終ジャッジ日時 2023-09-28 03:02:40
合計ジャッジ時間 2,562 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
23,440 KB
testcase_01 AC 31 ms
23,868 KB
testcase_02 AC 31 ms
24,060 KB
testcase_03 AC 32 ms
23,448 KB
testcase_04 AC 32 ms
23,420 KB
testcase_05 AC 33 ms
23,696 KB
testcase_06 AC 34 ms
24,024 KB
testcase_07 AC 32 ms
23,820 KB
testcase_08 AC 32 ms
23,856 KB
testcase_09 AC 31 ms
23,408 KB
testcase_10 AC 33 ms
24,072 KB
testcase_11 AC 33 ms
23,608 KB
testcase_12 AC 39 ms
24,048 KB
testcase_13 AC 38 ms
24,036 KB
testcase_14 AC 35 ms
23,488 KB
testcase_15 AC 35 ms
23,624 KB
testcase_16 AC 32 ms
24,276 KB
testcase_17 AC 31 ms
23,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))

ANS=[]
for i in range(N):
    MIN=min(A[i:])

    if MIN==A[i]:
        continue
    else:
        for j in range(i,N):
            if A[j]==MIN:
                ANS.append((i,j))
                A[i],A[j]=A[j],A[i]
                break

print(len(ANS),flush=True)
for x,y in ANS:
    print(x,y,flush=True)
D=input()
0