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

Обсуждение задачи 1004. Экскурсия

can i use floyd to solve this problem?
Послано ice_cream 2 авг 2010 16:34
i solve this problem with  floyd ,but i got crash
Re: can i use floyd to solve this problem?
Послано Vitalii Arbuzov 9 фев 2011 11:38
I think no.
After using Floyd you'll get d[i][j] - array with shortest paths and w[i][j] - array with intermediate vertexes.
However it will be impossible to find paths that does not contain duplicate vertexes (Floyd doesn't take care of that). And also Floyd will prefer short paths (e.g. 1,2,1) and it doesn't match to requirement of this problem.
So Floyd in it's original form is not applicable here.
Possibly some adoption is.
But I don't actually know how this adoption should work.

Re: can i use floyd to solve this problem?
Послано NotImplemented 22 фев 2014 22:40
It is applicable. You can run it instead of N Dijkstra algorithms.