|
|
back to boardCommon BoardWA in 1031 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 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. |
|
|