#include<iostream> #include<cstring> #include<algorithm> using namespace std; ; int p[N]; struct edge{ int a; int b; int w; }e[N*N]; int map[N][N],flag[N][N],num,n; bool cmp(edge a,edge b) { return a.w<b.w; } int find(int x) { if(p[x]…
poj 1251 && hdu 1301 Sample Input 9 //n 结点数A 2 B 12 I 25B 3 C 10 H 40 I 8C 2 D 18 G 55D 1 E 44E 2 F 60 G 38F 0G 1 H 35H 1 I 353A 2 B 10 C 40B 1 C 200Sample Output 21630 prim算法 # include <iostream> # include <cstdio> # include <cstr…
Constructing Roads Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 2421 Appoint description: System Crawler (2015-05-27) Description There are N villages, which are numbered from 1 to N, and y…
Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.Farmer John ordered a high speed connection for his farm and is going to share his…
接下来要滚去bzoj刷usaco的题目辣=v=在博客记录一下刷题情况,以及存一存代码咯.加油! 1.[bzoj1597][Usaco2008 Mar]土地购买 #include<cstdio> #include<algorithm> #include<cstring> using namespace std; ; int n,cnt,q[N]; long long x[N],y[N],f[N]; struct node{long long x,y;}a[N]; bool…