ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1085. Meeting

floyd-warshall or Dijkstra?
Posted by Sergey Zuev (LYC) 22 Apr 2009 20:48
Should I use Dijkstra's algorithm several times for each friend or just floyd-warshall?
Re: floyd-warshall or Dijkstra?
Posted by yuhc 15 May 2009 18:27
I think so
Re: floyd-warshall or Dijkstra?
Posted by Sergey Lazarev (MSU TB) 16 May 2009 00:25
You can use BFS.
Re: floyd-warshall or Dijkstra?
Posted by Velea Alex 13 Sep 2010 21:44
..? good q ..
but .. !
all the edge's cost's are 1 .. so .. :-)
use BFS .. for every friend from its starting position :-)

its n*k :-)

.. but i got WA 14 :-( ...


~~~~~~~~~~~~~~~~~~~~~~~~~~~

now i get it .. the WA's in the discuss are very useful :-)

and .. with my o(n*k)
i had .. 0.031    264 KB

Edited by author 13.09.2010 22:03

Edited by author 13.09.2010 22:03
Re: floyd-warshall or Dijkstra?
Posted by vlyubin 13 Apr 2012 09:08
Are you sure it's O(n*k)?
Re: floyd-warshall or Dijkstra?
Posted by MOPDOBOPOT (USU) 4 Aug 2012 02:38
I used DFS from every tramstop to find how much it costs for all of friends to meet here.
This test helped me a lot (it's funny to draw circles):

13 5
3 1 2 3
3 4 5 3
3 6 7 3
3 8 9 3
8 10 4 11 6 12 8 13 1

I corrected all mistakes by adding different situations on this tram-map :)