Banner Home Page DIY Contests Problems Ranklist Status Statistics
1010 BCD码 原来的题意有误 已修正 1011 原来数据精度有一组有问题

E. Yuna's confusion

Time Limit : 6000/3000ms (Java/Other)   Memory Limit : 65535/32768K (Java/Other)
Total Submission(s) : 60   Accepted Submission(s) : 30

Font: Times New Roman | Verdana | Georgia

Font Size:

Problem Description

After yuna studies the STL container,she finds the STL powerful for AC.For the k-th number, she is also very familiar with it. Now yuna meets a very similar problem, yuna wants to design a container, the container is to support the three operations,including add,del and query.
Although yuna is very intelligent, she can not think of how to do it, can you help her to solve this problem?

Input

Input contains multiple test cases.,Each test case the first number is an integer n (1 <= n <100000), means that the number of operation to do. The next m lines, each line will be an string at the beginning, s which has three values:
If s is “Add”, then there will be an integer i (0 <i <100000), means press element i into Container.
If s is “Del”, then there will be an integer i (0 <i <100000), indicated that delete the element i from the container
If s is “Query”, then there will be two integers x and k (0 <x <100000, 0 <k <10000),means the inquiries, the element is greater than x, and the k-th larger number.

Output

For each deletion, if you want to delete the element which does not exist, the output "No Elment!". For each query, output the suitable answers in line .if the number does not exist, the output "Not Find!".

Sample Input

5
Add 5
Del 2
Add 6
Query 3 2
Query 8 1
7
Add 2
Add 2
Add 4
Query 1 1
Query 1 2
Query 1 3
Query 1 4
5
Add 5
Add 5
Del 5
Del 5
Query 1 1

Sample Output

No Elment!
6
Not Find!
2
2
4
Not Find!
Not Find!

Author

Rexdf

Source

developing schools contest 5

Statistic | Submit | Back