博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PAT:1076. Forwards on Weibo (30) AC
阅读量:4558 次
发布时间:2019-06-08

本文共 569 字,大约阅读时间需要 1 分钟。

#include
#include
#include
#include
using namespace std; const int MAX=1010; bool tag[MAX]; //标记BFS是是否被访问过 struct node { int ID; //编号 int layer; //层号 }; vector
Adj[MAX]; //邻接表,每个位置都是一个node queue
q; //BFS待查询队列 int BFS(int s,int l) //起始点s,极限传播层数l { int transNum=0; //转发次数 node start; start.ID=s; start.layer=0; q.push(start); tag[s]=1; while(!q.empty()) { node tmp=q.front(); q.pop(); int u=tmp.ID; for(int i=0 ; i

转载于:https://www.cnblogs.com/Evence/p/4319662.html

你可能感兴趣的文章
正则\1\2和\\1的理解
查看>>
Python文件操作(一)
查看>>
Sage CRM 平衡区域树结构
查看>>
Codeforces Round #228 (Div. 1) C. Fox and Card Game 博弈
查看>>
电影票项目之Worker多线程
查看>>
APUE读书笔记-第16章-网络IPC: 套接字
查看>>
babel更新之后的 一些坑
查看>>
Python基础-Alex
查看>>
FTP权限问题解析,553 Can't open that file: Permission denied
查看>>
string.Format和cookie代码
查看>>
Django 1.11.7+django_pyodbc_azure-1.11.0.0+pyodbc 连接mssql 数据库
查看>>
NaN属性,isNaN函数
查看>>
Tomcat配置多线程和配置数据库连接池
查看>>
python解析oracle日志中的报错
查看>>
latex 去掉(不显示)空白页的页码与页眉
查看>>
Spring MyBatis多数据源分包
查看>>
HDOJ 1879 继续畅通工程
查看>>
spring Springmvc mybatis maven整合
查看>>
方法参数(值调用,引用调用)
查看>>
有名管道的非阻塞设置
查看>>