摘要:
很早之前就做过的题以前用并查集做的现在用DFS重做算是熟悉DFS吧#include#includeconst int size=1000;int graph[size][size];int visit[size];int cout;int n,m;void get_graph(){ memset(graph,0,sizeof(graph)); memset(visit,0,sizeof(visit)); int t1,t2; for(int i=0;i<m;i++) { scanf("%d%d",&t1,&t2); graph[t1][t2]=1; g 阅读全文