Thursday 17 October 2013

SPOJ : GHOSTS Wrong Answer(WA) / Time Limit Exceeded(TLE)

This problem!

1) If you are getting Wrong Answer : 

=> Check for the condition :
                      looping on the same node(1 1) ,(2 2)....
                      Example :  3
                                       3
                                       1 1
                                       2 2
                                       1 2



2) If you are getting Time Limit Exceeded :

=> Do-not add edge when there already exists a path between two nodes.
                       Example : if input is (a b) then there is no need to add edge if you  already have path from a to b ( a~>b) as it adds nothing to the given graph.





No comments:

Post a Comment

HEY! Nothing to say yet !! new to the blogging world...