Problem8817--[yosupo] Data Structure - Associative Array

8817: [yosupo] Data Structure - Associative Array

[Creator : ]
Time Limit : 1.500 sec  Memory Limit : 512 MiB

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]$

Input

$Q$
$\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$

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

HINT

相同题目:Yosupo

Source/Category