First,it is a problem about dijkstra and it so hard for beginner.
Second,I think even template questions need to be yellow.
There're my opnions,thank you for watch.