#P9809. [SHOI2006] 作业 Homework
[SHOI2006] 作业 Homework
Problem Description
You are given a set , which is initially empty. You need to perform the following two operations a total of times.
Operation 1: Add a new element to the set , with label . It is guaranteed that does not exist in the current set.
Operation 2: In the current set , query the minimum value of among all elements.
Input Format
The first line contains a positive integer .
The next lines each contain one character and one positive integer. If the character is A, this operation is Operation 1. If the character is B, this operation is Operation 2.
Output Format
For each Operation 2, output one line containing an integer representing the answer.
5
A 3
A 5
B 6
A 9
B 4
3
1
Hint
For of the testdata, , . The testdata guarantees that the first operation is Operation 1.
Translated by ChatGPT 5