| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 9272 | Max-Heap |
|
| 11415 | Word Scramble |
|
| 11462 | cppreference |
|
Description
Please maintain a max-heap, which stores integers and is able to support following operations:
(1) PUSH k – Insert an integer k into the heap. k will fit in a 32-bit signed integer.
(2) POP – Delete the maximum element from the heap.
(3) TOP – Print the maximum element in the heap.
Input
There is only one set of commands. Each command occupies a line, and the total number of commands is less than or equal to 500000. You may assume that the number of elements stored in the heap will be no more than 10000 at any time.
Output
For each “TOP” command, output a line containing the value of the element on the top of the heap. In case that the heap is empty, print ”Null” instead.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Write a program that will reverse the letters in each of a sequence of words while preserving the order of the words themselves.
Input
The input file will consist of several lines of several words. Words are contiguous stretches of printable characters delimited by white space.
Output
The output will consist of the same lines and words as the input file. However, the letters within each word must be reversed.
If the input is "I love you.", the output should be "I evol .uoy"