QOJ.ac

QOJ

时间限制: 1 s 内存限制: 512 MB 总分: 100

#18773. 数列とクエリ 15

统计

長さ $N$ の配列 $A_1, A_2, \ldots, A_N$ が与えられる。以下のクエリを処理するプログラムを作成せよ。

  • 1 i v: $A_i$ を $v$ に変更する。($1 \le i \le N$、$1 \le v \le 10^9$)
  • 2: 配列中の最小値のインデックスを出力する。最小値が複数ある場合は、最も小さいインデックスを出力する。

インデックスは1から始まる。

入力

1行目には配列の長さ $N$ が与えられる。($1 \le N \le 100{,}000$)

2行目には $A_1, A_2, \ldots, A_N$ が与えられる。($1 \le A_i \le 10^9$)

3行目にはクエリの個数 $M$ が与えられる。($1 \le M \le 100{,}000$)

続く $M$ 行にはそれぞれクエリが1つずつ与えられる。

出力

タイプ2のクエリごとに、1行に1つずつ答えを出力せよ。

入出力例

入力例 1

5
5 4 3 2 1
5
2
1 5 3
2
1 4 3
2

出力例 1

5
4
3

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.