(最小费用) POJ 2135 Farm Tour
来源:互联网 发布:我们相爱吧网络直播 编辑:程序博客网 时间:2024/06/06 03:19
Farm Tour
Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3424 Accepted: 1065
Description
When FJ's friends visit him on the farm, he likes to show them around. His farm comprises N (1 <= N <= 1000) fields numbered 1..N, the first of which contains his house and the Nth of which contains the big barn. A total M (1 <= M <= 10000) paths that connect the fields in various ways. Each path connects two different fields and has a nonzero length smaller than 35,000.
To show off his farm in the best way, he walks a tour that starts at his house, potentially travels through some fields, and ends at the barn. Later, he returns (potentially through some fields) back to his house again.
He wants his tour to be as short as possible, however he doesn't want to walk on any given path more than once. Calculate the shortest tour possible. FJ is sure that some tour exists for any given farm.
To show off his farm in the best way, he walks a tour that starts at his house, potentially travels through some fields, and ends at the barn. Later, he returns (potentially through some fields) back to his house again.
He wants his tour to be as short as possible, however he doesn't want to walk on any given path more than once. Calculate the shortest tour possible. FJ is sure that some tour exists for any given farm.
Input
* Line 1: Two space-separated integers: N and M.
* Lines 2..M+1: Three space-separated integers that define a path: The starting field, the end field, and the path's length.
* Lines 2..M+1: Three space-separated integers that define a path: The starting field, the end field, and the path's length.
Output
A single line containing the length of the shortest tour.
Sample Input
4 51 2 12 3 13 4 11 3 22 4 2
Sample Output
6
- poj 2135 Farm Tour (最小费用流成圈)
- POJ 2135 Farm Tour(最小费用流)
- (最小费用) POJ 2135 Farm Tour
- POJ 2135 Farm Tour(最小费用流)
- POJ 2135 Farm Tour 最小费用流
- POJ 2135 Farm Tour【最小费用流】
- poj 2135 Farm Tour(最小费用流)
- poj 2135 Farm Tour 最小费用流
- poj 2135 Farm Tour(最小费用问题)
- poj 2135 Farm Tour 【最小费用流】
- POJ 2135 Farm Tour 最小费用流
- POJ 2135 Farm Tour (最小费用最大流)
- POJ 2135 Farm Tour 最小费用最大流
- POJ 2135 Farm Tour (最小费用最大流)
- poj 2135 Farm Tour (最小费用最大流模板)
- POJ 2135 Farm Tour(最小费用最大流)
- poj 2135 Farm Tour 最小费用流入门模板
- poj 2135 Farm Tour 【最小费用最大流】
- 正则表达式和上下文无关文法
- orcad/allegro使用心的
- 朱伟:原创高质量软文创作四大秘籍
- 锁定SQL表的语句
- 精美模拟/数字时钟在MP3等数码产品中的应用
- (最小费用) POJ 2135 Farm Tour
- F#入门-第四章 面向对象-第四节 封装
- eclipse升级而不影响自定义插件的方法
- 阿里巴巴国际站产品排名在线查询工具
- 使用Bash编写Linux Shell脚本-7.复合命令
- HUDSON入门(转载) 关于持续集成单元测试
- [VB.Net]委托的一个简单示例
- QQ样式的在线客服代码
- PHP webService 技术一(使用XML-RPC)