Codeforces Round #500 (Div. 1) [based on EJOI] B. Chemical table(并查集)

NoSuchKey