标签:blog io for 2014 sp log html on c
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int maxm = 40010; const int maxn = 1010; int first[maxn], cnt; struct edge { int u, v, next; }e[maxn*maxn]; int ans[maxm]; bool vis[maxm]; int len; void AddEdge(int u, int v) { e[cnt].u = u; e[cnt].v = v; e[cnt].next = first[u]; first[u] = cnt++; } void dfs(int u) { for(int i = first[u]; i != -1; i = e[i].next) { if(!vis[i]) { vis[i] = true; dfs(e[i].v); ans[len++] = i; } } }
标签:blog io for 2014 sp log html on c
原文地址:http://blog.csdn.net/u011686226/article/details/39188253