Search found 7 matches

by phantom11
Tue Sep 24, 2013 3:42 pm
Forum: Volume 104 (10400-10499)
Topic: 10449 - Traffic
Replies: 58
Views: 21997

10449 - Traffic

I am getting Runtime Error for this problem. My algo is to run bellman ford to find all vertices in negative weight cycles and then run dfs for all nodes reachable by the ones in the negative weight cycles. I have also taken care that the vertex should be in the range [0,n-1] and it passes all test ...
by phantom11
Mon Sep 23, 2013 10:20 pm
Forum: Volume 5 (500-599)
Topic: 558 - Wormholes
Replies: 30
Views: 15032

558 - Wormholes

Cant understand why i am getting WA. Implemented Bellman Ford.

Code: Select all

Removed after AC. Was making a minor implementation mistake
by phantom11
Mon Sep 23, 2013 3:53 pm
Forum: Volume 114 (11400-11499)
Topic: 11492 - Babel
Replies: 18
Views: 10569

11492 - Babel

I am getting Runtime Error. Is there a problem in the test cases ? Here is my code: import java.util.List; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.Arrays; import java.io.BufferedWriter; import java.util.PriorityQueue; import j...
by phantom11
Thu Sep 19, 2013 7:54 am
Forum: Volume 120 (12000-12099)
Topic: 12047 - Highest Paid Toll
Replies: 8
Views: 2217

Re: 12047 : Highest Paid Toll getting TLE in java

Thanks for your reply. I agree i could have got Accepted in c++, but then I saw 35 odd java submissions with Accepted. So I thought that it is possible to get Accepted in java as well, and my code is not time efficient as it could be. So I posted it here
by phantom11
Wed Sep 18, 2013 11:59 am
Forum: Volume 120 (12000-12099)
Topic: 12047 - Highest Paid Toll
Replies: 8
Views: 2217

12047 : Highest Paid Toll getting TLE in java

I am getting TLE in this problem. I have first taken out the shortest path to each vertex in the original graph(g) from s, and then the shortest path to each vertex in reversed graph(rg) from t. Then for each edge(u,v,c), if shortest path in g to u + shortest path in rg to v + c <=p, then i am updat...
by phantom11
Sat Sep 14, 2013 4:31 pm
Forum: Volume 103 (10300-10399)
Topic: 10369 - Arctic Network
Replies: 45
Views: 24264

Re: Getting Wrong answer on 10369 Arctic Networks.

Thank you for the reply. I have changed the casting of ids from double by wrapping it in a class. Still I get the same wrong answer. Here is the full code.

Code: Select all

Removed after AC!! Thanks brianfry
by phantom11
Thu Sep 12, 2013 11:47 pm
Forum: Volume 103 (10300-10399)
Topic: 10369 - Arctic Network
Replies: 45
Views: 24264

Getting Wrong answer on 10369 Arctic Networks.

I have tried this problem , but I dont know why is it wrong.
I have sorted the edges. Initially I have p forests and everytime I take an edge, i decrease the number of forest by 1. I do so till I have s forest left, after which I output the last seen edge's weight.

Go to advanced search