博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
bzoj 1123 BLO
阅读量:4507 次
发布时间:2019-06-08

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

转载请注明出处:

http://www.cnblogs.com/hzoi-wangxh/p/7738615.html

1123: [POI2008]BLO

Description

Byteotia城市有n个 towns m条双向roads. 每条 road 连接 两个不同的 towns ,没有重复的road. 所有towns连通。

Input

输入n<=100000 m<=500000及m条边

Output

输出n个数,代表如果把第i个点去掉,将有多少对点不能互通。

Sample Input

5 5

1 2

2 3

1 3

3 4

4 5

Sample Output
8

8

16

14

8

题解:

其实就是个tarjan求点双。
点双并不用实际求出来,只是在搜索树中传上去,遇到割点求一下即可。
注意(x,y)和(y,x)是不同对点。

附上代码:

1 #include
2 #include
3 #include
4 #include
5 #include
6 #include
7 using namespace std; 8 #define int long long 9 #define mmin(a,b) (a
View Code

 

转载于:https://www.cnblogs.com/hzoi-wangxh/p/7738615.html

你可能感兴趣的文章
CentOS7 Failed to start LSB: Bring up/down networking.解决方法
查看>>
360浏览器文档模式升级
查看>>
MongoDB学习笔记(四)
查看>>
bzoj2301 [HAOI2011]Problem b(莫比乌斯反演)
查看>>
C#文件操作-File类
查看>>
winform中Dock的布局规则
查看>>
Java实现主线程等待子线程
查看>>
命令模式(Command)
查看>>
CozyRSS开发记录9-快速实现一个RSS解析器
查看>>
后端程序员之路 21、一个cgi的c++封装
查看>>
ha_innobase::open
查看>>
IIS6架构
查看>>
ELKStack-生产案例项目实战(十一)
查看>>
PHP图形处理函数试题
查看>>
幸运数
查看>>
Golang脱坑指南: goroutine(不断更新)
查看>>
nginx 3.nginx+fastcgi
查看>>
悲观与乐观
查看>>
[转载]:Invoke and BeginInvoke
查看>>
CodeForces Round 196
查看>>