This problem is in Contest(s) below:
Contest 1346:拓扑排序
Contest 1221:拓扑排序
Contest 1267:最短路 拓扑排序 带权并查集
Contest 1113:队测题