POJ2349 Arctic Network(Prim)】的更多相关文章

Arctic Network Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 16968   Accepted: 5412 Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication tec…
[Poj2349]Arctic Network Description 国防部(DND)要用无线网络连接北部几个哨所.两种不同的通信技术被用于建立网络:每一个哨所有一个无线电收发器,一些哨所将有一个卫星频道. 任何两个有卫星信道的哨所可以通过卫星进行通信,而不管他们的位置.同时,当两个哨所之间的距离不超过D时可以通过无线电通讯,D取决于对收发器的功率.功率越大,D也越大,但成本更高.出于采购和维修的方便,所有哨所的收发器必须是相同的:那就是说,D值对每一个哨所相同. 你的任务是确定收发器的D的最…
Arctic Network Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 17758   Accepted: 5646 Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication tec…
Arctic Network Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 19113   Accepted: 6023 Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication tec…
http://poj.org/problem?id=2349 Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the network: every outpost…
原题链接 先随便找一棵最小生成树,然后贪心的从大到小选择边,使其没有贡献. 显然固定生成树最长边的一个端点安装卫星频道后,从大到小选择边的一个端点作为卫星频道即可将该边的贡献去除. 所以最后的答案就是最小生成树上第\(m\)长的边. #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> using namespace std; const int N = 510; str…
2017-08-04 16:19:13 writer:pprp 题意如下: Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the network: every o…
Arctic Network Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 28311   Accepted: 8570 题目链接:http://poj.org/problem?id=2349 Description: The Department of National Defence (DND) wishes to connect several northern outposts by a wireless net…
Arctic Network Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9557   Accepted: 3187 Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication tech…
http://poj.org/problem?id=2349 Arctic Network Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 12544   Accepted: 4097 Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network.…
Arctic Network Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 2349 Appoint description:  System Crawler  (2015-06-01) Description The Department of National Defence (DND) wishes to connect seve…
Arctic Network 题目链接: http://acm.hust.edu.cn/vjudge/contest/124434#problem/F Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be use…
Arctic Network The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the network: every outpost will have a radio transceive…
G - Arctic Network   #include<cmath> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #define MAXN 510 using namespace std; double an; int fa[MAXN]; int t,n,m,tot,sum; double x[MAXN],y[MAXN],ans[MAXN]…
在北极圈有一些基地,这些基地需要建立通讯网络,他们可以通过卫星直接通信或者无线通信,基地有S个卫星,N个基地,不过无线通信的传输距离是D,距离越远费用越高,现在想知道D最小是多少. 分析:使用krusal添加p-s条边就行了,因为剩下的边肯定会比已经添加的边要长,在添加的边里面选取最长的那条,也就是最后添加的那条. ************************************************************************************ #inclu…
poj2349:http://poj.org/problem?id=2349 题意:有卫星电台的城市之间可以任意联络.没有卫星电台的城市只能和距离小于等于D的城市联络.告诉你卫星电台的个数S,让你求最小的D. 题解: 生成最小生成树,去掉最长的S条边后,剩下最长的边就是D.也就是求最小生成树中第S+1长的边. #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #…
题目链接: https://vjudge.net/problem/POJ-2349 题目大意: 要在n个节点之间建立通信网络,其中m个节点可以用卫星直接连接,剩下的节点都要用线路连接,求剩下这些线路中最大的长度需要多长 思路: 还是MST的裸题,由于有m个节点可以用卫星连接,所以求出MST后,最长的m-1条边都可以用卫星连接,只需要求出第m长的边即可,直接用prim算法,保存mst每条边的长度,排序后直接输出第m长的边. #include<iostream> #include<cstdi…
链接: http://poj.org/problem?id=2349 Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 13715   Accepted: 4424 Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two differe…
The Department of National Defence(DND)wishestoconnectseveral northern outposts by a wireless network. Two different communication technologies are to be used in establishing the network: every outpost will have a radio transceiver and some outposts…
/* The first line of each test case contains 1 <= S <= 100, the number of satellite channels! 注意:S表示一共有多少个卫星,那么就是有 最多有S-1个通道! 然后将最小生成树中的后边的 S-1通道去掉就行了! 思路:最小生成树中的第 k 个最小边! */ //克鲁斯克尔算法..... #include<iostream> #include<cstdio> #include<…
题目 /*********题意解说——来自discuss——by sixshine**************/ 有卫星电台的城市之间可以任意联络.没有卫星电台的城市只能和距离小于等于D的城市联络.题目告诉你卫星电台的个数S,让你求最小的D. 做最小生成树,去掉最长的S条边后,剩下最长的边就是D. 也就是求最小生成树中第S+1长的边. 完毕. /********************************************************/ //听说听木看懂之后,数据很水,果然…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1914 http://poj.org/problem?id=2349 题目大意,给定一些点的坐标,求MST,然后要求求去掉最大的k条边后,最大的边 直接Prim,然后在排序即可. 小技巧是一开始不求平方根,最后输出的时候在求出平方根即可. ZOJ上排行第三,不过在POJ就被虐了... #include<cstdio> #include<cmath> #incl…
[题意] 南极有n个科研站, 要把这些站用卫星或者无线电连接起来,使得任意两个都能直接或者间接相连.任意两个都有安装卫星设备的,都可以直接通过卫星通信,不管它们距离有多远. 而安装有无线电设备的两个站,距离不能超过D. D越长费用越多. 现在有s个卫星设备可以安装,还有足够多的无线电设备,求一个方案,使得费用D最少(D取决与所有用无线电通信的花费最大的那条路径). InputThe first line of input contains N, the number of test cases.…
描述 The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the network: every outpost will have a radio transceiver and some o…
题目链接:http://poj.org/problem?id=2349 Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the network: every out…
Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 25165   Accepted: 7751 Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are t…
Description The Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the network: every outpost will have a radio transceiver a…
试题描述: 国防部希望通过无线网络连接几个北方前哨基地. 在建立网络时将使用两种不同的通信技术:每个前哨基站都将拥有无线电收发器,另外还有一些前哨卫星通道. 任何带卫星频道的两个前哨都可以通过卫星进行通信,无论其位置如何. 否则,只有两个前哨基站之间的距离不超过D,才能通过无线电通信,这取决于收发器的功  率.  更高的功率产生更高的D,但成本更高. 由于采购和维护的考虑,前哨收发器必须相同; 也就是说,D的价值对于每对前哨都是一样的. 您的工作是确定收发器所需的最小D. 在每对前哨之间必须至少…
题意: 给定n个点, 要求修p-1条路使其连通, 但是现在有s个卫星, 每两个卫星可以免费构成连通(意思是不需要修路了), 问修的路最长距离是多少. 分析: s个卫星可以代替s-1条路, 所以只要求最小生成树, 排序后后去掉s-1条边, 最大那条就是答案. #include<iostream> #include<vector> #include<algorithm> #include<cstring> #include<cstdio> #incl…
题目链接: http://poj.org/problem?id=2349 题目大意: 有n个警戒部队,现在要把这n个警戒部队编入一个通信网络, 有两种方式链接警戒部队:1,用卫星信道可以链接无穷远的部队. 2,用信号收发器可以链接周围d米以内的部队. 现在有s个卫星信道,问d最小是多少时能连接全部的警戒部队? 解题思路: 我是用求最小生成树,记录路径长度,对路径长度排序后,第k长的边就是答案, 但是队友是用最小k度限制生成树,因为我的方法它证明不了,也推翻不了~~~~, 最后我下去仔细想了想反证…