結果

問題 No.875 Range Mindex Query
ユーザー Maeda, KazuyaMaeda, Kazuya
提出日時 2019-09-06 21:57:13
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 475 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 95,932 KB
最終ジャッジ日時 2023-09-06 23:47:08
合計ジャッジ時間 16,845 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,660 KB
testcase_01 AC 90 ms
77,084 KB
testcase_02 AC 90 ms
77,120 KB
testcase_03 AC 72 ms
75,660 KB
testcase_04 AC 77 ms
75,952 KB
testcase_05 AC 72 ms
75,796 KB
testcase_06 AC 85 ms
77,048 KB
testcase_07 AC 92 ms
77,160 KB
testcase_08 AC 76 ms
75,980 KB
testcase_09 AC 78 ms
75,968 KB
testcase_10 AC 91 ms
77,072 KB
testcase_11 TLE -
testcase_12 AC 1,778 ms
84,048 KB
testcase_13 TLE -
testcase_14 AC 1,944 ms
89,864 KB
testcase_15 TLE -
testcase_16 TLE -
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