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

Common Board

WA in 1031
Posted by Rodrigo Schmidt 9 Nov 2000 03:28
I'm trying to solve problem 1031 - RailWay Tickets using the
Dijkstra's algorithm for the shortest path in graphs. My
implementation looks "right" but I've received WA.

I talked to a friend who tried to solve this problem using
Floyd's algorithm and also received WA.

What's wrong?

Thanks,
Rodrigo
Re: WA in 1031
Posted by Jivko Ganev 9 Nov 2000 12:14
No need for dijkstra or floyd since the graph type is
special.It looks exactly like the graphs used for project
networks.Just use the simplest dynamic programming you can
think of.Also did you notice that the start station isn't
always with lower id than the end station, this could be
the problem.