当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

BZOJ4579:[Usaco2016 Open]Closing the Farm

题目描述
Farmer John and his cows are planning to leave town for a long vacation, and so FJ wants to temporar
ily close down his farm to save money in the meantime.The farm consists of NN barns connected with M
M bidirectional paths between some pairs of barns (1≤N,M≤200,000). To shut the farm down, FJ plans
 to close one barn at a time. When a barn closes, all paths adjacent to that barn also close, and ca
n no longer be used.FJ is interested in knowing at each point in time (initially, and after each clo
sing) whether his farm is "fully connected" -- meaning that it is possible to travel from any open b
arn to any other open barn along an appropriate series of paths. Since FJ's farm is initially in som
ewhat in a state of disrepair, it may not even start out fully connected.
给你N点M边的无向图(1<=N,M<=200000),一共删n次点,
每次询问删这个点之前是否完全联通

输入解释
The first line of input contains N and M. The next M lines each describe a path in terms of the pair
 of barns it connects (barns are conveniently numbered 1…N). The final N lines give a permutation o
f 1…N describing the order in which the barns will be closed.

输出解释
The output consists of N lines, each containing "YES" or "NO". The first line indicates whether the 
initial farm is fully connected, and line i+1 indicates whether the farm is fully connected after th
e iith closing.

输入样例
4 3
1 2
2 3
3 4
3
4
1
2
输出样例
YES
NO
YES
YES
提示

BZPRO Powered by Remmina.
Github Repository
来自acmore.cc的附加信息
bzoj_id 4579
import_source_sha256 4cdcd8514bbdcd0c580fd10830fcf602965f3553f03d2c53e67cff610b7501d3
bzoj_checker_pending False

该题目包含在题集 大视野(八中)OJ 中

题目来源 BZOJ 4579

源链接: LOCAL-BZOJ4579

共提交 0 次

通过率 --%
时间上限 内存上限
10000 MS 128 MB