上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 31 下一页
摘要: /*最小生成树,用Prim算法使用BZ数组*/#include#define INF 200int g[110][110],bz[110],low[110];int min,ans,Q,n,a,b;void prim(){ int i,j,k,x; for (i=1;i<=n;i+... 阅读全文
posted @ 2014-08-11 20:46 2014acm 阅读(134) 评论(0) 推荐(0) 编辑
摘要: //hnldyhy(303882171) 8:54:04#include // poj 1258#include using namespace std; #define N 105int p[N];void init (int n){ for (int i=1;i>n&&n>=3) ... 阅读全文
posted @ 2014-08-11 20:04 2014acm 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-08-11 20:00 2014acm 阅读(81) 评论(0) 推荐(0) 编辑
摘要: // poj 2421 prim/*最小生成树,用Prim算法有n个城镇,已知每两个城镇的距离,其中某些城镇之间的道路已经修好,要求用最少的路径修完剩下的城镇之间的路*/#include#define InF 2000int g[110][110],bz[110],low[110];int min,... 阅读全文
posted @ 2014-08-11 19:56 2014acm 阅读(162) 评论(0) 推荐(0) 编辑
摘要: #include // poj 1258 10.1.5.253 1505using namespace std; #define N 105 // 顶点的最大个数 (多写 int a[N][N],low[N],n,ans;int min(int x,int y){ ... 阅读全文
posted @ 2014-08-11 19:54 2014acm 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-08-11 19:49 2014acm 阅读(103) 评论(0) 推荐(0) 编辑
摘要: // hnldyhy(303882171) 15:56:57 // poj 1988/*思路:找到含X的那叠箱子的箱子总数减去X上面的箱子数再减1就是所要的答案。如果a堆在b上,那么b上面的箱子数就是等于含a的那叠箱子的总数;*/#include #define N 30001int p[N];i... 阅读全文
posted @ 2014-08-10 20:03 2014acm 阅读(156) 评论(0) 推荐(0) 编辑
摘要: //1482#include #include using namespace std;int n,d;struct point{ int x,y,z,t;}a[1005];int find(int x ){ if(a[x].z==x) return x; else return ... 阅读全文
posted @ 2014-08-10 20:02 2014acm 阅读(100) 评论(0) 推荐(0) 编辑
摘要: //1481#include #include using namespace std;#define N 50010int parent[N],sum;void init(){ for(int i=1;in || y> n) {sum--;continue;} ... 阅读全文
posted @ 2014-08-10 20:01 2014acm 阅读(136) 评论(0) 推荐(0) 编辑
摘要: #include #includeusing namespace std;#define N 50010int p[N]; void init(int n){ for(int i=1 ;i#include #include #include #include #include using name... 阅读全文
posted @ 2014-08-10 19:59 2014acm 阅读(182) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 31 下一页