cf/mirror

Upside Down Dijkstra

CF
2206C2200· master2s1024 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
5 7
3 4
2 3
1 2
3 5
1 4
1 5
4 5
1 4 3 5 2
Output
6 1 3 1 3 2 2
Sample 2of 2
Input
4 4
1 2
2 3
1 3
2 4
1 3 4 2
Output
impossible
2206C.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…