Bob and Ball
题号:NC207826
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Bob loves balls.
Now there are n operations. Each operation may be one of the following two:
0 x ,means Bob gets a ball with a color of x
1 x,query how many balls Bob has with color x
Please answer each query.

输入描述:

The first line contains an integer N representing the number of operations
Next N line indicate the operations.

输出描述:

Please answer each query that how many balls Bob has with color x.
示例1

输入

复制
5
0 1
0 1
1 1
0 1
1 1

输出

复制
2
3

说明

At 3 th operation, there is 2 balls with color 1
At 5 th operation, there is 3 balls with color 1