Codeforces Round #541 (Div. 2) D. Gourmet choice 并查集 拓扑排序

NoSuchKey