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

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

O(n^3) algo.
Послано hoan 12 ноя 2010 11:11
this is a O(n^3) algo for this problem:
- for each node such v, first you use dijekstra which have a "v" as a root, then you   clacute the:
            k= E.wei + dis[E.e1]+ dis[E.e2].
  where E is a edge that not exist in a tree of dijekstra algo, and E is
  a (e1, e2). and at the end you must print the minimum of all the k.

sorry for my poor english.

Edited by author 12.11.2010 11:12

Edited by author 12.11.2010 11:13
Re: O(n^3) algo.
Послано Artem Khizha [DNU] 20 июл 2011 23:52
Well, I solved this problem in O(n^4) fixing a deleted edge and then running dijkstra from one it's vertex to the other, but I want to get better. :-)

However I failed to understand your post at all. Could you explain it somehow?
Re: O(n^3) algo.
Послано Yarko 7 ноя 2011 01:37


Edited by author 13.01.2012 05:11
Re: O(n^3) algo.
Послано smile_iff 11 ноя 2011 12:10
I read all the posts, collected input test cases posted by people, and passed all of them successfully, but, unfortunately, still i am getting WA#test case 1. Tried everything. But found no clue why my solution is getting WA. Please help me out.
Re: O(n^3) algo.
Послано scythe 3 мар 2012 18:44
Very good idea, thanks for sharing!