#include#include #include #include #include using namespace std; const int maxn=30; int head[maxn],ip,indegree[maxn]; int n,m,seq[maxn]; struct note { int v,next; } edge[maxn*maxn]; void init() { memset(head,-1,sizeof(head)); ip=0; } void addedge(int u,int v) { edge[ip].v=v,edge[ip].next=head[u],head[u]=ip++; } int topo()///拓撲,可做模板 { queue q; int indeg[maxn]; for(int i=0; i