摘要:
dfs输出原图所有拓扑序就行了。#include<cstdio>#include<cstring>#include<cctype>using namespace std;int d[30],head[30],nc,n;struct edge{ int to,next;}edge[200];void add(int a,int b){ edge[nc].to=b;edge[nc].next=head[a];head[a]=nc++;}char ans[30];void dfs(int k){ if(k==n) { puts(ans); retu... 阅读全文