1076 Forwards on Weibo (30 分)

#include
#include
#include
#include
using namespace std;
const int maxn=1010;
int N, L;
int inque[maxn];
struct Node{
	int layer;
	vectorfans;
}arr[maxn];
queueq;
int bfs(int s){
	int num=0;
	q.push(s);
	inque[s]=1;
	arr[s].layer=0;
	while(!q.empty()){
		int u=q.front();
		q.pop();
		// 1 2 3 ... L 层都可以
		if(arr[u].layer>=1&&arr[u].layer<=L) num++;
		for(int i=0; i

 

你可能感兴趣的:(advanced_pat)