Codeforces Round #600 (Div. 2) - D. Harmonious Graph(并查集)

NoSuchKey