Collection of numbers

Your task is to write a program that mantains a collection of integer numbers, possibly repeated, and that does the operation according to the indications of the user:

Input

The input consists of a sequence of orders as the described ones, each one in a line.

Output

For each done query, your program must print in a line the greatest number in that moment. Also, it must print an error line for each operation (except the store operation) when the collection does not have any number, following the format of the instance.

Hint: Notice that the collection can have repeated elements. Moreover, is necessary that your solution is very fast: if you have never used heaps (priority_queue) or (map), you should take advantage to learn. Perhaps asking in the forum... (when the contest ends, of course).

Author: Salvador Roura

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T10:11:00.456Z

© Jutge.org, 2006–2026.
https://jutge.org