题目链接:USACO - Controlling Companies
对每个结点进行一次bfs。bfs时,当且仅当被起始点控制的点入队。然后最后可以得到所有被控制的点。
/*
ID: xdujlx1
PROG: concom
LANG: C++
*/
#include<bits/stdc++.h>
using namespace std;
int d[107];
int G[107][107];
bool vis[107];
vector<int> adj[107];
题目链接:USACO - Controlling Companies
对每个结点进行一次bfs。bfs时,当且仅当被起始点控制的点入队。然后最后可以得到所有被控制的点。
/*
ID: xdujlx1
PROG: concom
LANG: C++
*/
#include<bits/stdc++.h>
using namespace std;
int d[107];
int G[107][107];
bool vis[107];
vector<int> adj[107];