Multiple implement !!!

uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1187

In above problem , we need to run floyd-warshal 2 time . Why we need to do so ?
My solution : http://ideone.com/b7mvHJ

Thanks in advance :slight_smile:

thatโ€™s because your solution is wrong. Check the if condition of your F-W algorithm again!