Don't miss this point , The First input roads are not all bi - directionalIn the description of the blocks in the proposal should be understood that the blocks are oriented going out from the first element in the line to each of the adjacent elements (the same fact applies to the old configuration).
Don't Use memset_value too high ( I used 10^8 & Floyd-Warshall)