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

Турниры > CEN112 Questions 2016 > задача:


15-FE-3. 50994 - The Most Crowded Station

CEN112 Questions 2016

Старт: 30.мар.2016 в 15:10:22
Финиш: 01.апр.2016 в 05:00:00
Турнир завершён!
• Турнирная таблица

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

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

• 15-FE-1. 50992 - Top K Obese Classes
• 15-FE-2. 50993 - Products in store
• 15-FE-3. 50994 - The Most Crow...
• 15-FE-4. 50995 - Group Average
• 15-FE-6. 50989 - Rectangles and Points
• 15-FE-7. 50990 - Two Neighbors
• 15-FE-8. 50991 - Intersecting Circles
• 15-HW-2. 50932 - Shifting rows and...
• 15-HW-3. 50933 - Sum of the Bigges...
• 15-HW-4. 50934 - Selling Cars
• 15-HW-5. 50935 - Max Discount

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

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

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

The Most Crowded Station

Question: There are several stations and many people get on and off the train. For each person in every station, you are given the number of stations that he travels. Find the station on which the most number of people get off the train.

Input specification: In the first line, you will be given an integer: the number of stations (n). Then in the following n lines, you will be given several integers ending with a negative number. Each number represents the number of stations that this person is going to travel where 1 ≤ n ≤ 1,000 and you have at most 100 people on every station.

Output specification: Show one integer. If there are several stations with the same max number of people, show the number of the first station.

Sample Input
4
3 4 2 -1
2 2 -1
2 1 1 -2
1 1 -1
Sample Output
3

Explanation: There are four stations. In starting station (station 0), There are 3 people getting on the train. The first one will get off after 3 stations, the second person will get off after 4 stations. There is person getting off on the first station. Here is the chart showing the number of people getting off on each station.

Station # # of People
1 0
2 1
3 5
4 4



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

www.contester.ru