ACM: 最大流问题 图论题 poj 2263
来源:互联网 发布:网络安全工程师年薪 编辑:程序博客网 时间:2024/05/22 02:25
Description
Given start and destination city, your job is to determine themaximum load of the Godzilla V12 so that there still exists a pathbetween the two specified cities.
Input
Then r lines will follow, each one describing one road segment bynaming the two cities connected by the segment and giving theweight limit for trucks that use this segment. Names are not longerthan 30 characters and do not contain white-space characters.Weight limits are integers in the range 0 - 10000. Roads can alwaysbe travelled in both directions.
The last line of the test case contains two city names: start anddestination.
Input will be terminated by two values of 0 for n and r.
Output
- a line saying "Scenario #x" where x is the number of the testcase
- a line saying "y tons" where y is the maximum possibleload
- a blank line
Sample Input
4 3
Karlsruhe Stuttgart 100
Stuttgart Ulm 80
Ulm Muenchen 120
Karlsruhe Muenchen
5 5
Karlsruhe Stuttgart 100
Stuttgart Ulm 80
Ulm Muenchen 120
Karlsruhe Hamburg 220
Hamburg Muenchen 170
Muenchen Karlsruhe
0 0
Sample Output
Scenario #1
80 tons
Scenario #2
170 tons
题意: 找出一条路起点到终点的最大载货量, 但是每条路径都有重量限制, 要你求出最大的载货量.
解题思路:
代码:
#include<cstdio>
#include <iostream>
#include <cstring>
using namespace std;
#define MAX 205
char a[MAX], b[MAX];
int g[MAX][MAX];
char str[MAX][55];
int num;
int start, end;
int n, m;
inline int max(int a,int b)
{
}
inline int min(int a,int b)
{
}
int find(char *ch)
{
}
void read_graph()
{
}
void floyd()
{
}
int main()
{
//
}
- ACM: 最大流问题 图论题 poj 2263
- ACM: 图论题 poj 3308 最大流问题
- ACM: 最小费用最大流 图论题 poj 2…
- ACM: 最大流 图论题 poj 1797
- ACM: 图论题 poj 1149 网络流问题
- ACM: 最小费用用最大流 图论题 poj…
- ACM: 二分图最大匹配 图论题 poj 2…
- ACM: 图论题 poj 1466 最大独立团
- ACM: 图论题 poj 2240 (floyd + ST…
- ACM: 图论题 poj 1135
- ACM: 图论题 poj 3…
- ACM: 图论题 poj 1…
- ACM: 图论题 poj 1…
- ACM: 二分法 数论题 poj 1905
- ACM: 匈牙利算法 图论题 poj 3041 …
- ACM: 差分约束 图论题 poj 2983 sp…
- ACM: 有向欧拉图 图论题 poj 1386 …
- ACM: 图论题 poj 3177 同 3352
- ACM: 有向欧拉图 图论题 poj 1386 …
- ACM: 二分图最大匹配 图论题 poj 2…
- Largest prime 尤拉托斯展那筛选法
- ACM: 图论题+记忆DP poj 2662 (边…
- 进程与线程区别
- ACM: 最大流问题 图论题 poj 2263
- ACM: 简单动态规划题 poj 2955
- 第一章 答疑摘选
- ACM: 树状DP 动态规划题 poj 1463 …
- 华为测试题图片排序(简单的冒泡排序)
- ACM: 贪心法 poj 1700
- ACM: 博弈题 poj 1067
- ACM: 动态规划题+剪枝 toj 3904
- ACM: 动态规划题 toj 1072