結果

問題 No.875 Range Mindex Query
ユーザー Maeda, KazuyaMaeda, Kazuya
提出日時 2019-09-06 21:56:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 475 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 10,752 KB
実行使用メモリ 21,408 KB
最終ジャッジ日時 2023-09-06 23:43:48
合計ジャッジ時間 4,430 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,288 KB
testcase_01 AC 24 ms
7,844 KB
testcase_02 AC 28 ms
7,732 KB
testcase_03 AC 16 ms
7,852 KB
testcase_04 AC 19 ms
7,816 KB
testcase_05 AC 19 ms
7,800 KB
testcase_06 AC 27 ms
7,840 KB
testcase_07 AC 22 ms
7,908 KB
testcase_08 AC 20 ms
7,808 KB
testcase_09 AC 20 ms
7,912 KB
testcase_10 AC 35 ms
7,944 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, q = map(int, input().split())
a = list(map(int, input().split()))

for i in range(q):
    query = input().split()
    if query[0] == '1':
        l = int(query[1]) - 1
        r = int(query[2]) - 1
        temp = a[l]
        a[l] = a[r]
        a[r] = temp
    else:
        minV = 10**10
        minIdx = 0
        for i in range(int(query[1])-1, int(query[2])):
            if a[i] < minV:
                minV = a[i]
                minIdx = i
        print(minIdx+1)
0