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

Обсуждение задачи 1888. Стаж пилотов

test 24
Послано Magnitogorsk STU 30 окт 2011 14:03
Can you public this test or tell about idea in it? Yesterday we can't got "Accepted", because always got "WA 24" (Magnitogorsk STU). We have no idea about our mistake.
Maybe test is incorrect?
Re: test 24
Послано Nadeem Moidu 30 окт 2011 19:59
Are you correctly handling the case when the graph is disconnected?
Re: test 24
Послано ...†.†.†... Stigius ...†.†.†... 30 окт 2011 20:59
Test is correct, you have already asked it during the contest and have already had an answer. Idea of you mistake is that you cannot assume that the most distant vertex from some randomly chosen is an end of diameter. It is true for a tree, but not for an arbitrary graph.
If you are still unsure, I can send you this test via email, if you tell me your address.
Re: test 24
Послано svr 30 окт 2011 21:27
I also had many WAs. I used only 1 bfs. But when I applied n bfs for each vertex as a root and took best with respect of height of bfs-tree I got Ac.