zoj 1586 QS Network】的更多相关文章

ZOJ - 1586 QS Network (Prim) #include<iostream> #include<cstring> using namespace std; +; ;//无穷远 int n; int cost[maxn]; int Edge[maxn][maxn]; int lowcost[maxn]; void Init() { cin>>n; ;i<n;i++) {//读入每个结点的适配器价值 cin>>cost[i]; } ;i&…
QS Network Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 1586 Appoint description:  System Crawler  (2015-05-31) Description Sunny Cup 2003 - Preliminary Round April 20th, 12:00 - 17:00 Problem…
题目: In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each other via networks. If two QS want to get connected, they need to buy two network adapters (one for each QS) and a segment of network cab…
QS Network Sunny Cup 2003 - Preliminary Round April 20th, 12:00 - 17:00 Problem E: QS Network In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each other via networks. If two QS want to get conne…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=586 题目大意: QS是一种生物,要完成通信,需要设备,每个QS需要的设备的价格不同,并且,这种设备只能在两个QS之间用一次,也就是说,如果一个QS需要和3个QS通信的话,它就必须得买3个设备,同时,对方三个也必须买对应的适合自己的设备.同时,每两个QS之间是有距离的,要完成通信还需要网线,给出每两个QS之间的网线的价值.求一棵生成树,使得所需要的费用最少.数据范围:所有数据都…
最小生成树,刚刚学了Prim算法. 对每条边变的权值进行预处理,c[i][j] = c[i][j] + p[i] + p[j] 其中c[i][j]为输入的权值,p[i],p[j]为连接这两个节点所需的费用. #include<stdio.h> #include<string.h> #include<math.h> #include<algorithm> using namespace std; ; int c[maxn][maxn];//邻接矩阵 int x…
链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1586 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=82831#problem/E In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each o…
QS Network Time Limit: 2 Seconds      Memory Limit: 65536 KB Sunny Cup 2003 - Preliminary Round April 20th, 12:00 - 17:00 Problem E: QS Network In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with ea…
QS Network 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1586 Description: In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each other via networks. If two QS want to get conn…
QS Network Time Limit: 2 Seconds      Memory Limit: 65536 KB Sunny Cup 2003 - Preliminary Round April 20th, 12:00 - 17:00 Problem E: QS Network In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with ea…