1604 Tree Cutting
来源:互联网 发布:linux mv移动所有文件 编辑:程序博客网 时间:2024/06/04 08:40
Tree Cutting
总提交: 2 测试通过: 1
描述
After Farmer John realized that Bessie had installed a "tree-shaped" network among his N (1 <= N <= 10,000) barns at an incredible cost, he sued Bessie to mitigate his losses.
Bessie, feeling vindictive, decided to sabotage Farmer John's network by cutting power to one of the barns (thereby disrupting all the connections involving that barn). When Bessie does this, it breaks the network into smaller pieces, each of which retains full connectivity within itself. In order to be as disruptive as possible, Bessie wants to make sure that each of these pieces connects together no more than half the barns on FJ.
Please help Bessie determine all of the barns that would be suitable to disconnect.
输入
* Lines 2..N: Each line contains two integers X and Y and represents a connection between barns X and Y.
输出
样例输入
101 22 33 44 56 77 88 99 103 8
样例输出
38
提示
The set of connections in the input describes a "tree": it connects all the barns together and contains no cycles.
OUTPUT DETAILS:
If barn 3 or barn 8 is removed, then the remaining network will have one piece consisting of 5 barns and two pieces containing 2 barns. If any other barn is removed then at least one of the remaining pieces has size at least 6 (which is more than half of the original number of barns, 5).
题目来源
USACO December 04
- 1604 Tree Cutting
- Tree Cutting
- poj 2378 Tree Cutting
- poj2378 Tree Cutting
- poj2378(Tree Cutting)
- POJ 2378 Tree Cutting
- POJ2378:Tree Cutting(DFS)
- POJ 2378 Tree Cutting
- poj 2378 Tree Cutting
- poj2378(dfs) Tree Cutting
- POJ 2378 Tree Cutting
- poj2378,Tree Cutting
- poj 2378 Tree Cutting
- Tree Cutting (树形DP)
- poj 2378 Tree Cutting
- [POJ 2378] Tree Cutting
- Hdu 5909 Tree Cutting
- HDU5909 Tree Cutting
- J2ee 常用的jar包作用
- 有关CHtmlView中屏蔽context menu
- 光棍节
- MyEclipse太耗内存启动慢的优化解决方案!
- sockaddr与sockaddr_in结构体简介
- 1604 Tree Cutting
- 伪原创的三招两式
- WinForm 标尺和网格 改良版
- EVC编程点滴-GIF动画显示类---------转
- 【转贴】透明纹理
- ORA-1157, cannot identify/lock data file - see DBWR trace file
- 写好C程序的10大要点
- 光棍节,单身快乐!
- 珍惜珍惜,好好努力!