class Dijkstra { import std.container : BinaryHeap; import std.typecons; import std.format : format; size_t N; long[] cost; size_t[][] graph; long delegate (int, int) getCost; BinaryHeap!(Tuple!(size_t, long)[], "b[1]