In case there are not walks of length n, just print `no walk of length n'
But there is no sample input for this case and unfortunately it isn't say that we should write the concrete value of n.
So the correct output for n=5 if there is no path should be: no walk of length 5
If i undertstood right the problem statement must be changed.
There are two opposite statements
1. In other words, the distinct walks of length n between the i-th and j-th nodes of V may be more than one. Note that the node in the paths can be repetitive.
2. The output file must contain all distinct walks of the length n, and with all its nodes different
I got wa first, when i followed 1st statement.
then got acc, when changed to 2nd statement.
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman