結果
| 問題 | No.875 Range Mindex Query |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-06 21:57:13 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 475 bytes |
| 記録 | |
| コンパイル時間 | 334 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 95,616 KB |
| 最終ジャッジ日時 | 2024-06-24 17:45:51 |
| 合計ジャッジ時間 | 14,443 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 12 TLE * 4 -- * 2 |
ソースコード
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)