上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 30 下一页
摘要: 最小树形图模板题 #include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <stack> #include 阅读全文
posted @ 2016-05-10 21:16 shuguangzw 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 最小树形图,就是给有向带权图中指定一个特殊的点root,求一棵以root为根的有向生成树T,并且T中所有边的总权值最小。 朱刘算法模板题 #include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #in 阅读全文
posted @ 2016-05-10 18:17 shuguangzw 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 模板题 #include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <stack> #include <queu 阅读全文
posted @ 2016-05-10 11:20 shuguangzw 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 又是求次小生成树,就是求出最小生成树,然后枚举不在最小生成树上的每条边,求出包含着条边的最小生成树,然后取一个最小的 #include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cst 阅读全文
posted @ 2016-05-10 11:00 shuguangzw 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 分析:http://www.cnblogs.com/wally/archive/2013/02/04/2892194.html 这个题就是多一个限制,就是求包含每条边的最小生成树,这个求出原始最小生成树然后查询就好了 然后预处理那个数组是O(n^2)的,这样总时间复杂度是O(n^2+m) 这是因为这 阅读全文
posted @ 2016-05-09 22:58 shuguangzw 阅读(127) 评论(0) 推荐(0) 编辑
摘要: http://www.acmerblog.com/hdu-3642-get-the-treasury-6603.html 学习:三维就是把竖坐标离散化分层,每一层进行线段树二维面积并就好了 阅读全文
posted @ 2016-05-09 21:18 shuguangzw 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 同 POJ1151 这次是两次 #include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <stack> #i 阅读全文
posted @ 2016-05-09 21:08 shuguangzw 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 分析:感觉一看就是二分+线段树,没啥好想的,唯一注意,当开始摆花时,注意和最多能放的比大小 #include<iostream> #include<cmath> #include<cstdio> #include<algorithm> #include<cstring> using namespac 阅读全文
posted @ 2016-05-09 20:12 shuguangzw 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 这个题让我重新学习了加 乘 在区间的操作 题解:http://blog.csdn.net/guognib/article/details/25324025?utm_source=tuicool&utm_medium=referral 代码:也是参考上面的写的 注:确实有优先级,加只影响自己,乘会影响 阅读全文
posted @ 2016-05-07 15:43 shuguangzw 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 考虑动态规划 F[i] 代表以第 i 个字符为结尾的平衡串个数, 预处理出每个与右括号匹配的左括号 j,如果存在的话, 那么 f[i]=f[j-1]+1; 复杂度也是 O(n)。 #include <stdio.h> #include <string.h> #include <math.h> #in 阅读全文
posted @ 2016-05-07 09:22 shuguangzw 阅读(128) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 30 下一页