Hi Experts . I have about to Solve this Simple Floyd Warshall problem . I wrote the Code & Test the Random Inputs & Outputs of uDebug . They are okey for my Code . But I don't know Why I am getting Wrong Answer ??? What is the Critical Points I am missing ?? Please help me in finding out the Critical Points of the Problems ...
=> My Code : http://ideone.com/ZRGBBr
[ Some Critical Tests and Points are Appreciable ]
Thanks in Advance . Thanks in Advance .
I don't know exactly what is wrong with your code. I read it and the idea seems correct. Maybe there's something not working as expected in between all those variables and conditionals.
I implemented a similar idea and got accepted. Here is my code for reference, maybe it'll help you: C++ Code
Why did you used here unordered_set??
I always use unordered_set when I don't need the elements to be ordered. Here, I just needed to check how many different elements there were, so unordered_set is the way to go.