ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > CEN_114 Midterm B > задача:


7. 50496 - Falling Bricks

CEN_114 Midterm B

Старт: 14.мая.2020 в 00:00:01
Финиш: 31.мая.2020 в 23:59:59
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 12. 50749 - Min Distance
• 13. 51124 - Easy Tiae words
• 14. 51136 - Class Average 2
• 15. 50734 - Product Info (In Srt)
• 2. 50453 - The Cubic Difference
• 3. 50346 - The Biggest Date
• 5. 50380 - Sum of the Numbers in t...
• 6. 50443 - Dajte Express
• 7. 50496 - Falling Bricks
• 8. 51123 - Mr. Li Criteria
• 9. 50529 - Row to Table

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Falling Bricks

You want to start as a programmer in a company. They have asked you to implement a game: Falling Bricks. In this game, you have a series bricks (integers) with some bombs (negative numbers) among them.

Question: Write a program that is going to read bricks information. And then, your program will print the wall after bricks fall down.

Input specification
You will be given an integer (n) the number of bricks where 1 ≤ n ≤ 2000. Then in the following n lines, you will be given integers where zero and positive numbers represent the bricks and negative numbers represent the bombs. The first brick is the brick at the bottom and the last brick is the one at the top.

Output specification
Show first the number of bombs and then, show the bricks after removing the holes. Start showing from the top brick.

Sample Input I
6
7
-2
-5
0
-1
3
Sample Output I
3
3 0 7

Explanation:
3 bombs have been removed. Then, the remaining bricks are 3 0 and 7.



Для отправки решений необходимо выполнить вход.

www.contester.ru