上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 50 下一页
摘要: 1.Prim算法:cost[a][b]和cost[b][a]都得赋值。 /* Prim算法 Prim求MST 耗费矩阵cost[][],标号从0开始,0~n-1 返回最小生成树的权值,返回-1表示原图不连通 */ #include<iostream> #include<stdio.h> #inclu 阅读全文
posted @ 2016-04-07 20:03 gongpixin 阅读(209) 评论(0) 推荐(0) 编辑
摘要: c. /* 并查集模板 */ #include<iostream> #include<stdio.h> #include<string.h> using namespace std; #define MAXN 1024 int fa[MAXN]; int set_find(int d){ if(fa 阅读全文
posted @ 2016-04-07 20:02 gongpixin 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 1.kmp /* kmp */ #include<iostream> #include<stdio.h> #include<string.h> using namespace std; #define MAXN 1024//字符串长度 int _next[MAXN]; void GetNext(ch 阅读全文
posted @ 2016-04-06 20:47 gongpixin 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 所有排序默认均为升序。 一、插入排序 1.1直接插入排序 /* 直接插入排序 */ #include<iostream> #include<stdio.h> using namespace std; void InsertSort(int R[],int n){//对R[0..n-1]按递增有序进行 阅读全文
posted @ 2016-04-06 20:09 gongpixin 阅读(301) 评论(0) 推荐(0) 编辑
摘要: ps:实现是实现了,但错误未知,甚用。 ps:代码有点臃肿,凑和用着。 ps:能用java就用java,其次手写,最后套用这个。 整数: 1.int数组 /* 整数大数 int数组实现 */ #include<iostream> #include<stdio.h> #include<stdlib.h 阅读全文
posted @ 2016-04-06 19:58 gongpixin 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 1 阅读全文
posted @ 2016-04-06 19:36 gongpixin 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 23 阅读全文
posted @ 2016-04-06 19:19 gongpixin 阅读(184) 评论(0) 推荐(0) 编辑
摘要: ID Origin Title 17 / 60 Problem A ZOJ 3537 Cake 54 / 105 Problem B LightOJ 1422 Halloween Costumes 59 / 90 Problem C POJ 2955 Brackets 26 / 51 Problem 阅读全文
posted @ 2016-04-06 19:18 gongpixin 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 21 阅读全文
posted @ 2016-04-06 19:17 gongpixin 阅读(142) 评论(0) 推荐(0) 编辑
摘要: ID Origin Title 20 / 60 Problem A HDU 3507 Print Article 13 / 19 Problem B HDU 2829 Lawrence 1 / 5 Problem C HDU 4528 小明系列故事――捉迷藏 5 / 6 Problem D HDU 阅读全文
posted @ 2016-04-06 19:16 gongpixin 阅读(351) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 50 下一页