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

Турниры > APGC-1 > задача:


5. 51073 - Campus Tours for High Schools

APGC-1

Старт: 04.фев.2017 в 18:00:00
Финиш: 05.фев.2017 в 14:00:00
Турнир завершён!
• Турнирная таблица

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

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

• 1. 51069 - Last Digit of a Fibonacci ...
• 2. 50458 - Weekly Report
• 3. 50742 - King Arthur II
• 4. 50930 - Tom and Jerry
• 5. 51073 - Campus Tours for Hi...
• 6. 50694 - The Cheapest Flight

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

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

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

Campus Tours for High Schools

Epoka University is organizing Campus Tours for high schools of Tirana this Tuesday. Each high school though, can come within a certain time period [ai, bi] only.

Question: You want to find the minimum number of bus trips so that all high schools are satisfied and within their planned timeframe.

Input specification The first line of the input contains the number of schools (n). Each of the following n lines contains two integers ai and bi (separated by a space) defining available time frame of the i-th high school (the school will be happy if the bus takes students within this time frame) where n is between 1 and 40,000 and 0 ≤ ai ≤ bi ≤ 23.

Output specification First print the minimum number m of time points on the first line and the integer values of m time points (separated by spaces) on the second line.

 Sample Input I
3
1 3
2 5
3 6
Sample Input II
4
4 7
1 3
2 5
5 6
Sample Output I
1
3
Sample Output II
2
3 6

Explanation: (for Sample 1:) There are three schools coming. And all schools are available at three o'clock. One bus is sufficient to take students from all three schools.

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

www.contester.ru