POJ1797 Heavy Transportation】的更多相关文章

题目链接:http://poj.org/problem?id=1797 题意:给定n个点,m条边,每条边连接两点切有权值.求点1到点n的路径的上的最小边的值最大... 翻别人博客找到的题,方法挺多的,直接跑一个最大生成树就行,或者是一个最短路算法也行 我自己用了prim和kruskal 的方法来做 虽然用最短路也可以轻松过,但是我还是选择了生成树 prim #include<cstdio> #include<cmath> #include<algorithm> #inc…
题目电波: 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: 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…
题目链接: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…
传送门 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…
题目链接: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 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…
解题思路:典型的Kruskal,不能用floyed(会超时),上代码: #include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define inf 0x3f3f3f3f ; int father[maxn]; struct node{ int x, y, w; }p[maxn*maxn]; //第一次开maxn,RE了一次 int cmp(node A, node B)…
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…