8817: [yosupo] Data Structure - Associative Array
[Creator : ]
Description
You are given an array $a$ with infinite length. Initially, all elements are $0$. Process the following $Q$ queries in order.
- 0 $k$ $v$: $a[k] \gets v$
- 1 $k$: Print $a[k]$
- 0 $k$ $v$: $a[k] \gets v$
- 1 $k$: Print $a[k]$
Input
$Q$
$\textrm{Query}_0$
$\textrm{Query}_1$
:
$\textrm{Query}_{Q - 1}$
$\textrm{Query}_0$
$\textrm{Query}_1$
:
$\textrm{Query}_{Q - 1}$
Constraints
$1 \leq Q \leq 10^5$
$0 \leq k, v \leq1,000,000,000,000,000,000$
$0 \leq k, v \leq1,000,000,000,000,000,000$
Sample 1 Input
8
0 1 2
1 1
1 2
0 2 3
1 1
1 2
0 2 1
1 2
Sample 1 Output
2
0
2
3
1