• 拓扑排序
    以入度为0的做起点
    vector top_sort(){
    priority_queue ,greater >Q;
    for(int i=1;i<=n;i++){
        if(!indeg[i]){
            Q.push(i);
        }
    }
    std::vector TOP;
    while(!Q.empty()){
        int T=Q.top();
        Q.pop();
        indeg[T]=-1;
        TOP.push_back(T);
        for(auto &e:graph[T]){
            indeg[e]--;
            if(indeg[e]==0)Q.push(e);
        }
    }return TOP;
    }
    }