Ограничения: время – 500ms/1000ms, память – 256MiB Ввод: input.txt или стандартный ввод Вывод: output.txt или стандартный вывод
Послать решение Blockly Посылки Темы Где Обсудить (0)
The recent earthquake in Great Binair did not affect too much the buildings in the capital, which was at the
epicenter of the quake. But the scientists found that it affected the dike wall, which now has a significant
structural failure in its underground part that, if not repaired quickly, can cause the collapse of the dike,
with the consequent flooding the whole capital.
The repair must be done by divers, at a large depth, under extremely difficult and dangerous conditions.
But since the survival of the city is at stake, its residents came out in large numbers to volunteer
for this dangerous mission.
As is traditional in dangerous missions, each diver received at the start of his/her mission a small
card with an identification number. At the end of their mission, the volunteers returned the nameplate, placing
it in a repository.
The dike is safe again, but unfortunately it seems that some volunteers did not return from their
missions. You were hired for the grueling task of, using the list of the plates taken from or
placed in the repository, determine which volunteers lost their lives to save the city.
Input
The input is composed of two lines. The first line contains
one integer `K` (`1\ ≤\ K\ ≤\ 10\ 000`), indicating the length of the list. The second line contains
a sequence of `K` integers. The negative integer `-X` indicates, that the diver with identification
number `X` went to the mission, the positive integer `X` indicates, that the diver with
identification number `X` returned from the mission. Volunteers are identified by numbers from 1 to `10^6`.
Output
Your program must produce a single line containing the identifiers of the volunteers who did not
return from their missions, in ascending order of their identifications. Leave a
blank space after each identifier (notice that, therefore, there must be a blank
space after the last identifier in the line). If every volunteer returned, the
line must contain a single character '*' (asterisc).
Sample Input #1
8
-3 -4 -1 3 -2 -9 1 9
Sample Input #2
8
-5 -3 5 -7 -5 3 7 5