Codeforces Round #599 (Div. 2) D. 0-1 MST(bfs+set)

NoSuchKey