HDU 3416 Marriage Match IV
来源:互联网 发布:央视电视直播软件apk 编辑:程序博客网 时间:2024/06/06 00:24
2011-05-17
21:01:42
Marriage Match IV
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 709 Accepted Submission(s): 188
Problem Description
Do not sincere non-interference。
Like that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A and girls are in city B. Every time starvae can get to city B and make a data with a girl he likes. But there are two problems with it, one is starvae must get to B within least time, it's said that he must take a shortest path. Other is no road can be taken more than once. While the city starvae passed away can been taken more than once.
So, under a good RP, starvae may have many chances to get to city B. But he don't know how many chances at most he can make a data with the girl he likes . Could you help starvae?
Like that show, now starvae also take part in a show, but it take place between city A and B. Starvae is in city A and girls are in city B. Every time starvae can get to city B and make a data with a girl he likes. But there are two problems with it, one is starvae must get to B within least time, it's said that he must take a shortest path. Other is no road can be taken more than once. While the city starvae passed away can been taken more than once.
So, under a good RP, starvae may have many chances to get to city B. But he don't know how many chances at most he can make a data with the girl he likes . Could you help starvae?
Input
The first line is an integer T indicating the case number.(1<=T<=65)
For each case,there are two integer n and m in the first line ( 2<=n<=1000, 0<=m<=100000 ) ,n is the number of the city and m is the number of the roads.
Then follows m line ,each line have three integers a,b,c,(1<=a,b<=n,0<c<=1000)it means there is a road from a to b and it's distance is c, while there may have no road from b to a. There may have a road from a to a,but you can ignore it. If there are two roads from a to b, they are different.
At last is a line with two integer A and B(1<=A,B<=N,A!=B), means the number of city A and city B.
There may be some blank line between each case.
For each case,there are two integer n and m in the first line ( 2<=n<=1000, 0<=m<=100000 ) ,n is the number of the city and m is the number of the roads.
Then follows m line ,each line have three integers a,b,c,(1<=a,b<=n,0<c<=1000)it means there is a road from a to b and it's distance is c, while there may have no road from b to a. There may have a road from a to a,but you can ignore it. If there are two roads from a to b, they are different.
At last is a line with two integer A and B(1<=A,B<=N,A!=B), means the number of city A and city B.
There may be some blank line between each case.
Output
Output a line with a integer, means the chances starvae can get at most.
Sample Input
37 81 2 11 3 12 4 13 4 14 5 14 6 15 7 16 7 11 76 71 2 12 3 11 3 33 4 13 5 14 6 15 6 11 62 21 2 11 2 21 2
Sample Output
211题意:求完全不同的最短路数目;题解:先SPFA再用处于最短路上的边建图,容量1;
- HDU 3416 Marriage Match IV
- hdu 3416 Marriage Match IV
- HDU 3416 Marriage Match IV
- HDU 3416 Marriage Match IV
- HDU 3416 Marriage Match IV
- HDU-3416 Marriage Match IV
- Marriage Match IV HDU
- Marriage Match IV HDU
- hdu 3416 Marriage Match IV dijkstra + isap
- HDU 3416 Marriage Match IV (SPFA+Dinic)
- 3416 Marriage Match IV
- hdu 3416 Marriage Match IV 最大流 最短路径
- HDU 3416 Marriage Match IV(spfa+最大流)
- hdu 3416 Marriage Match IV 【网络最大流+最短路】
- HDU 3416 Marriage Match IV(最短路+最大流)
- 【HDU】 3416 Marriage Match IV(最大流+SPFA)
- Marriage Match IV (hdu 3416 网络流+spfa最短路)
- HDU - 3416 Marriage Match IV (最大流)
- C语言字符串函数大全
- C语言字符串函数大全
- iPhone开发技巧之发布篇(4)--- 使用 Ad Hoc 发布自己的应用程序
- flex, swf 不能访问网络/本地资源
- TCPIPChap6ICMP
- HDU 3416 Marriage Match IV
- TCPIPChap8Traceroute
- linux连公司vpn的方法
- 思维导图初体验--ITrade
- 浅谈String和StringBuffer类(java编程基础)
- iPhone开发技巧之工具篇(1)--- 将XIB文件转换为Objective-C源程序
- jquery的客户端校验:jquery-validation
- POJ 1833 排列的应用
- iPhone开发技巧之工具篇(2)--- Accessorizer自动化生成代码的工具