题目 题解: 拓扑排序,难度挺低,但是细节很多。 其中一个注意点:c[i]即便是负数,也要进队,不然有些点入度始终大于0,更新不了 标程: #include<bits/stdc++.h> using namespace std; struct kk{ int x,y; }a[103]; struct node{ int to,ne,w; }e[10003]; int n,m,i,j,x,y,z,num,out[103],in[103],u,q[103],c[103],U[103],head[103],tot,h,t,v; void add(int x,int y,int z){ ...