洛谷 P3916 图的遍历(反向建边+DFS)
这道题很妙,用反向建边+DFS#include<iostream>#include<cstdio>#include<cstring>#define MAXN 100010#define MAXM 200010using namespace std;int n,m,u,v,cnt,head[MAXN],A[MAXN];struct Edge{ int to,nxt;}edge[MAXM];void addedge(int u,int v){
原创
2020-07-11 20:05:40 ·
260 阅读 ·
0 评论