ZOJhttp://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1914 POJhttp://poj.org/problem?id=2349 UVAhttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1310 题目大意,给定一些点的坐标,求MST,然后要求求去掉最大的k条边后,最大的…
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…
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…
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&…
偶数矩阵(Even Parity, UVa 11464) 问题描述 给你一个n×n的01矩阵(每个元素非0即1),你的任务是把尽量少的0变成1, 使得每个元素的上.下.左.右的元素(如果存在的话)之和均为偶数. 比如,如(a)所示的矩阵至少要把3个0变成1,最终如图(b)所示,才能保证其为偶数矩阵. 看图! 输入格式 输入的第一行为数据组数T(T≤30).每组数据的第一行为正整数n(1≤n≤15): 接下来的n行每行包含n个非0即1的整数,相邻整数间用一个空格隔开. 输出格式 对于每组数据,输出…
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 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…
[Poj2349]Arctic Network Description 国防部(DND)要用无线网络连接北部几个哨所.两种不同的通信技术被用于建立网络:每一个哨所有一个无线电收发器,一些哨所将有一个卫星频道. 任何两个有卫星信道的哨所可以通过卫星进行通信,而不管他们的位置.同时,当两个哨所之间的距离不超过D时可以通过无线电通讯,D取决于对收发器的功率.功率越大,D也越大,但成本更高.出于采购和维修的方便,所有哨所的收发器必须是相同的:那就是说,D值对每一个哨所相同. 你的任务是确定收发器的D的最…
题目链接:poj 1144 题意就是说有 n(标号为 1 ~ n)个网点连接成的一个网络,critical places 表示删去后使得图不连通的顶点,也就是割顶,求图中割顶的个数. 直接上大白书上的模板即可,只是输入也有点卡人,我竟然傻傻的用手写的输入挂来处理,看了别人的博客才知道用 scanf("%s") 即可,因为 scanf("%s") 不会读入空格,再适当处理下即可. 我的代码是: #include<cstdio> #include<cs…
                           Cable TV Network Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 4678   Accepted: 2163 Description The interconnection of the relays in a cable TV network is bi-directional. The network is connected if there is…