This problem is in Contest(s) below:
Contest 1267:最短路 拓扑排序 带权并查集
Contest 1355:最靓的仔
Contest 1355:最靓的仔