3035 - 2024_DS_Summer_Lab4 Scoreboard

Time

2024/07/08 13:00:00 2024/07/19 13:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
14320 2024_IDS_Spring_Lab9_Min_Heap

14320 - 2024_IDS_Spring_Lab9_Min_Heap   

Description

Please implement a binary min heap that supports the following operations:

- `1 x`: Insert number x
- `2`: Remove an element with smallest value in the heap.  If the heap is already empty, ignore this command.
- `3`: Report the smallest number in the heap.  If the heap is already empty, print "EMPTY" (without quotation mark).

Input

The first line contains an integer q, being the number of operations.

The following lines are the operations described in the problem statements.

Restrictions

- 1 <= q <= 2 * 106
- -109 <= x <= 109

Output

For each query with type 3, print the answer in one line.

Sample Input  Download

Sample Output  Download

Tags




Discuss