>>151
まず、サンプルの実行結果だけど、
-----
input the number of vertices n and the number of edges m
4 3
input tail and head of an edge m times
1 2
1 3
2 3

adjacency list
1: 1 2
2: 3
3:
4:

path: a tail head
1: 10 0 0
2: 1 1 2
3: 3 2 3
-----
隣接リスト(adjacency list)で1に対して1、2って正しいのか?
2、3が正しいと思うんだが、
それと最期のpath: と a って何? a[1]=10になってるしサンプルバグってね?