ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1040. Авиакомпания

Is 1,2,4,6,5,3 also right??????????
Послано bobchennan 3 май 2009 09:55
Who can tell me?
I have WA1.
Thanks a lot.

Edited by author 03.05.2009 09:55

Edited by author 03.05.2009 09:56

Edited by moderator 13.05.2009 01:51
Re: Is 1,2,4,6,5,3 also right??????????
Послано Kurpilyansky Eugene (USU) 3 май 2009 23:25
"If there are several flights that depart from one airport then the greatest common divisor of their flight numbers should be equal to 1."

input
6 6
1 2
2 3
2 4
4 3
5 6
4 5
output
1 2 4 6 5 3
This output isn't correct because for second flight (2, 3) gcd is equal to 2 != 1.

Edited by moderator 13.05.2009 01:52
Re: Is 1,2,4,6,5,3 also right??????????
Послано MAK 22 июл 2010 09:52
O_o

"If there are several FLIGHTS that depart from one AIRPORT then the greatest common divisor of their flight numbers should be equal to 1."

Why did you calculate gcd for the second flight? Output is a numbers of flights, not numbers of flights.

May be you should do this for the second airport. However gcd of the flight numbers of the second airport is gcd(1,2,4) = 1.

P.S. I think output is not right because gcd of the flight numbers from the airport #3 is equal to 2.

Edited by author 22.07.2010 10:00