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

Обсуждение задачи 1314. Погоня в метро

any hints?
Послано Tim Green 19 апр 2004 13:39
Re: any hints?
Послано Wendell 20 апр 2004 15:17
Bellman-Ford
i got wa test 3
Послано test 20 апр 2004 15:22
Re: i got wa test 3
Послано twotowers.bin 21 апр 2004 00:39
I too

Edited by author 21.04.2004 00:39
Re: any hints?
Послано Alone alone ! 22 апр 2004 14:11
I used two SSSP algo (BFS + DFS) to solve the problem. Can it be done with only one ?
Re: any hints?
Послано Thadeu Russo - UAM 22 апр 2004 20:42
how to determinate the shortest route??? Why in the test input  the criminal goes to 85 and not to 10 or 75????
Just 2 BFSs.
Послано Maigo Akisame (maigoakisame@yahoo.com.cn) 28 окт 2004 08:34
First do BFS with the first node in the criminal's route. Save the result in the array d1. Do another BFS with the last node in the criminal's route, and save the result in the array d2. For any node i, if d1[i]-d2[i]=m-1, then i is an answer.

The graph is always connected.
Re: Just 2 BFSs.
Послано Denis Koshman 1 авг 2008 05:05
I build BFS traversal tree by giving priorities to points on the route (i.e. advance them first). Children of the last route node gain privelege for the rest of traversal (if you process nodes in the order they were first visited, this condition is automatic because they will be added prior to any other nodes during last privileged propagation).

After BFS tree is ready, nodes reachable from last node on the route inside that tree form the answer.

Edited by author 01.08.2008 05:09