一.题目 POJ1797 二.分析 题意就是让你找到从1到n的一条路,由于边的最大称重限制,你需要确定限制的最小值,也就是能运输的最大值. 可以结合最小生成树想,利用并查集,然后不断更新答案即可,需要注意的是题意是1到n走到就可以了,并不需要走到每个点,所以不是完整的最大生成树,所以当1与n共父节点时直接返回结果即可. 三.AC代码 1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 #i…
题目链接:POJ 1797 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his customer has build his giant…
题目链接:http://poj.org/problem?id=1797 题意:给定n个点,m条边,每条边连接两点切有权值.求点1到点n的路径的上的最小边的值最大... 翻别人博客找到的题,方法挺多的,直接跑一个最大生成树就行,或者是一个最短路算法也行 我自己用了prim和kruskal 的方法来做 虽然用最短路也可以轻松过,但是我还是选择了生成树 prim #include<cstdio> #include<cmath> #include<algorithm> #inc…
题目链接:http://poj.org/problem?id=1797 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his custom…
Heavy Transportation 题目链接: http://acm.hust.edu.cn/vjudge/contest/66569#problem/A Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether th…
poj 1797 Heavy Transportation Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his customer has…
传送门 Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 31882   Accepted: 8445 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever…
OpenJudge 799:Heavy Transportation 总时间限制: 3000ms 内存限制: 65536kB 描述BackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the…
Heavy Transportation Time Limit:3000MS     Memory Limit:30000KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1797 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. B…
Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 26968   Accepted: 7232 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man…
题目链接:http://poj.org/problem?id=1797 Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 30840   Accepted: 8191 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand…
Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 22440   Accepted: 5950 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man…
Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 21037   Accepted: 5569 Description Background  Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man…
Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 53170   Accepted: 13544 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man…
POJ 1797 Heavy Transportation / SCU 1819 Heavy Transportation (图论,最短路径) Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there reall…
链接: http://poj.org/problem?id=1797 Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 25089   Accepted: 6647 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand b…
Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 52728   Accepted: 13474 题目链接:http://poj.org/problem?id=1797 Description: Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expan…
poj 1797 ——Heavy Transportation 思路: 这道题我们可以采用类似于求最短路径的方法,用一种新的“松弛操作”去取代原本的方法. 我们可以记录d[u]为运送货物到点j时最大可载重量.那么对于一条边(x,y),我们有d[y]=max(d[y],min(d[x],v(x,y))). 因此,我们可以直接仿照spfa/dijkstra算法求最短路径的方法解决这道题目. 这道题实际上也是可以通过最小生成树方法解决,不过这里需要求的是最大生成树. 我们可以得出对于所求的路径,实际上…
题目链接:http://poj.org/problem?id=1797 Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 39999   Accepted: 10515 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand…
Heavy Transportation POJ 1797 最短路变形 题意 原题链接 题意大体就是说在一个地图上,有n个城市,编号从1 2 3 ... n,m条路,每条路都有相应的承重能力,然后让你求从编号为1的城市到编号为n的城市的路线中,最大能经过多重的车. 解题思路 这个题可以使用最短路的思路,不过转移方程变了\(dis[j]=max(dis[j], min(dis[u], e[u][j]))\).这里dis[j]表示从标号为1的点到达编号为j的点的路径中,最小的承重能力,就像短板效应样…
F - Heavy Transportation Time Limit:3000MS     Memory Limit:30000KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1797 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand busines…
题目电波: POJ--1797 Heavy Transportation n点m条边, 求1到n最短边最大的路径的最短边长度 改进dijikstra,dist[i]数组保存源点到i点的最短边最大的路径的最短边长度 #include<iostream> #include<cstring> #include<algorithm> #include<stdio.h> using namespace std; #define maxn 100010 #define…
Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K Total Submissions:46898   Accepted: 12204 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man…
POJ.1797 Heavy Transportation (Dijkstra变形) 题意分析 给出n个点,m条边的城市网络,其中 x y d 代表由x到y(或由y到x)的公路所能承受的最大重量为d,求从1到n的所有通路中,所能经过的的最大重量的车为多少. 2. 代码总览 #include <cstdio> #include <cstring> #include <algorithm> #include <queue> #include <stack&…
Heavy Transportation Time Limit:3000MS     Memory Limit:30000KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1797 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. B…
原题链接:http://poj.org/problem?id=1797 Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 24576   Accepted: 6510 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand…
Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his customer has build his giant steel crane to the place…
题目链接: http://poj.org/problem?id=1797 Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his customer has buil…
题面 Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his customer has build his giant steel crane to the pla…
传送门 1.最大生成树 可以求出最大生成树,其中权值最小的边即为答案. 2.最短路 只需改变spfa里面的松弛操作就可以求出答案. ——代码 #include <queue> #include <cstdio> #include <cstring> using namespace std; ; int T, n, m, cnt; int head[MAXN], next[MAXN * MAXN], to[MAXN * MAXN], val[MAXN * MAXN], d…