Escape Time II Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2966 Description In last winter, there was a big snow storm in South China. The electric system was damaged seriously. Lots of p…
Build The Electric System Time Limit: 2 Seconds      Memory Limit: 65536 KB In last winter, there was a big snow storm in South China. The electric system was damaged seriously. Lots of power lines were broken and lots of villages lost contact with t…
就是套了个prim算法就ac了 #include <stdio.h> #include <string.h> #define MaxInt 0x3f3f3f3f #define N 510 /*创建map二维数组储存图表,low数组记录每2个点间最小权值,visited数组标记某点是否已访问*/ int map[N][N],low[N],visited[N]; int n; int prim() { ; memset(visited,,sizeof(visited)); /*从某点…
有n个城市,有m条线路,每条线路a,b,len表示a到b的线路需要花费len的费用维修,要求能将所有城市联通的最小维修花费 按照排序排一下然后利用并查集解决 #include <iostream> #include <set> #include <string.h> #include <algorithm> using namespace std; struct node { int a; int b; int len; }road[500*500+100]…
Sublime Text 3 Build 3065 All System CracKed By Hmily[LCG] <ignore_js_op> 程序员文本编辑器 Sublime Text 3 Build 3065 全平台破解版,windows 32 bit or 64 bit.Ubuntu 32 bit or 64 bit.OS X全部支持. Sublime Text 是一个轻量.简洁.高效.跨平台的编辑器.Sublime Text 的特色功能:良好的扩展功能,官方称之为安装包(Packa…
题目连接:problemId=542" target="_blank">ZOJ 1542 POJ 1861 Network 网络 Network Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge Andrew is working as system administrator and is planning to establish a new network in his com…
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=4081 Qin Shi Huang's National Road System Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5428    Accepted Submission(s): 1902 Problem Description…
点击打开链接题目链接 Qin Shi Huang's National Road System Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5023    Accepted Submission(s): 1749 Problem Description During the Warring States Period of anci…
题目链接: Qin Shi Huang's National Road System Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others) Problem Description   During the Warring States Period of ancient China(476 BC to 221 BC), there were seven kingdoms in Ch…
分析:http://www.cnblogs.com/wally/archive/2013/02/04/2892194.html 这个题就是多一个限制,就是求包含每条边的最小生成树,这个求出原始最小生成树然后查询就好了 然后预处理那个数组是O(n^2)的,这样总时间复杂度是O(n^2+m) 这是因为这个题n比较小,如果n大的时候,就需要路径查询了,比如LCA 或者树链剖分达到O(mlogn) #include <iostream> #include <algorithm> #incl…