Description
Given start and destination city, your job is to determine the maximum load of the Godzilla V12 so that there still exists a path between the two specified cities.
Input
Then r lines will follow, each one describing one road segment by naming the two cities connected by the segment and giving the weight limit for trucks that use this segment. Names are not longer than 30 characters and do not contain white-space characters. Weight limits are integers in the range 0 - 10000. Roads can always be travelled in both directions.
The last line of the test case contains two city names: start and destination.
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 test case
- a line saying "y tons" where y is the maximum possible load
- 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()
{
//
}