#abc283b. B - First Query Problem
B - First Query Problem
Score : points
问题描述
你将得到一个整数 和一个长度为 的序列 。
针对给定的 个查询,请按照给定顺序处理它们。每个查询属于以下两种类型之一:
1 k x
:将值 设置为 。2 k
:输出值 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given an integer and a sequence of length .
Given queries, process them in the given order. Each query is of one of the following two kinds:
1 k x
: set the value to .2 k
: print the value .
Constraints
- for all queries.
- for all queries of the first kind.
- There is at least one query of the second kind.
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Here, denotes the -th query, given in one of the following formats:
Output
Print lines, where is the number of queries of the second kind. The -th line should contain the response to the -th such query.
Sample Input 1
3
1 3 5
7
2 2
2 3
1 3 0
2 3
1 2 8
2 2
2 1
Sample Output 1
3
5
0
8
1
Initially, .
- For the -st query, , where , so should be printed.
- For the -nd query, , where , so should be printed.
- The -rd query sets the value to , making .
- For the -th query, , where , so should be printed.
- The -th query sets the value to , making .
- For the -th query, , where , so should be printed.
- For the -th query, , where , so should be printed.
Sample Input 2
5
22 2 16 7 30
10
1 4 0
1 5 0
2 2
2 3
2 4
2 5
1 4 100
1 5 100
2 3
2 4
Sample Output 2
2
16
0
0
16
100
Sample Input 3
7
478 369 466 343 541 42 165
20
2 1
1 7 729
1 6 61
1 6 838
1 3 319
1 4 317
2 4
1 1 673
1 3 176
1 5 250
1 1 468
2 6
1 7 478
1 5 595
2 6
1 6 599
1 6 505
2 3
2 5
2 1
Sample Output 3
478
317
838
838
176
595
468
update @ 2024/3/10 11:51:33