Test cases for Abroads

abroads
algorithm
bfs
data-structure
dsu
graph
ltime3

#1

This is my solution for The Ancient Berland Roads I am not getting why this solution is incorrect. It is passing all the test cases that I have made but I am not getting what are the test cases which my solution is not passing.

Can any one tell me why this solution is incorrect or If what could be the appropriate test cases for it. It would be a great help.

Thanks in advance.


#2

You can generate random test cases here : http://www.spojtoolkit.com/TestCaseGenerator/
And test its output using one of the given solution.

Most of the time you the bug in a few minutes.