B. Mike and Feet Codeforces Round #305 (Div. 1) (并查集)

NoSuchKey