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

Обсуждение задачи 1218. Episode N-th: The Jedi Tournament

Saturn How to solve this problem? [5] // Задача 1218. Episode N-th: The Jedi Tournament 27 июл 2004 23:54
Dmitry 'Diman_YES' Kovalioff BFS (-) [3] // Задача 1218. Episode N-th: The Jedi Tournament 28 июл 2004 09:27
Saturn Re: BFS (-) // Задача 1218. Episode N-th: The Jedi Tournament 28 июл 2004 12:06
Thank you,I got AC!
UXMRI: Sergey Baskakov, Raphail Akhmedisheff and Denis Nikonorov I think I used a different approach. Please, specify yours more precisely. [1] // Задача 1218. Episode N-th: The Jedi Tournament 21 ноя 2005 00:44
My solution is based on the concept of strong connectivity. I find connected components of the graph, then I print those jedis, that belong to the non-dominated component. It is npt very quick, but it works. I don't know, how BFS can help with this problem. Any explanation will be very much appreciated.

(de bene esse: my e-mail is akhmed[at]astranet[dot]ru).
for each start among knights
 mark all that can be reached from start thru winning
 if all are marked then print start's name

To test your speed, you can use the following perl script to generate input:

$n = 200;
print "$n\n";
for(1..$n){
    print "J$_"; print ' ', int(rand()*100000) for 1..3; print "\n"
}
Alexey Dergunov [Samara SAU] Re: How to solve this problem? // Задача 1218. Episode N-th: The Jedi Tournament 8 июл 2012 03:35
O(N*log(N)) solution exists :)