【BZOJ】【P2435】【Noi2011】【道路修建】【题解】【dfs】

传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=2435

说好的卡爆栈呢

Code;

#include
using namespace std;
const int maxn=1e6+5;
struct edge{int v,w;};
vectorG[maxn];
typedef long long LL;
LL sum=0,ans=0;
int size[maxn],vis[maxn],n;
void dfs(int u){
	size[u]=1;edge e;
	for(int i=0;i


你可能感兴趣的:(OI)