上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 50 下一页
摘要: http://blog.csdn.net/u014552756/article/details/50583944 阅读全文
posted @ 2016-03-18 20:42 gongpixin 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 相关: http://www.cnblogs.com/vongang/archive/2012/04/01/2429015.html http://www.cnblogs.com/kuangbin/archive/2013/05/21/3090793.html 阅读全文
posted @ 2016-03-18 18:45 gongpixin 阅读(158) 评论(0) 推荐(0) 编辑
摘要: d.最长上升子序列 s.注意是严格递增 c.O(nlogn) #include<iostream> #include<stdio.h> using namespace std; const int MAXN=1005; int a[MAXN],b[MAXN]; //b[k]是序列a中所有长度为k的递 阅读全文
posted @ 2016-03-17 18:20 gongpixin 阅读(274) 评论(0) 推荐(0) 编辑
摘要: d.求对字符串最少添加几个字符可变为回文串。 s. 法1:直接对它和它的逆序串求最长公共子序列长度len。N-len即为所求。(N为串长度) 因为,要求最少添加几个字符,我们可以先从原串中找到一个最长回文子序列,然后对于原串中不属于这个回文子序列的字符,在串中的相应位置添加一个相同的字符即可。那么需 阅读全文
posted @ 2016-03-16 21:21 gongpixin 阅读(653) 评论(0) 推荐(0) 编辑
摘要: c.空间40 c'.空间3 阅读全文
posted @ 2016-03-16 21:01 gongpixin 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 个人发现的比较优秀的博客,放到这里,以便学习使用: http://www.cnblogs.com/kuangbin http://www.cnblogs.com/zsf123 http://www.cnblogs.com/shuguangzw/ ps:有些代码是从上述博客或者网上直接粘贴。 阅读全文
posted @ 2016-03-14 18:25 gongpixin 阅读(191) 评论(0) 推荐(0) 编辑
摘要: d.n个节点的树,删除一个点,得到的最大联通分支大小不大于总节点数的一半,求这样点的集合 s.树形dp c.网上找的一个,看着头文件啥的可以参考,先贴在着,抽空自己写写 #include <map> #include <set> #include <list> #include <cmath> #i 阅读全文
posted @ 2016-03-14 18:23 gongpixin 阅读(232) 评论(0) 推荐(0) 编辑
摘要: d.一颗树,选最少的点覆盖所有边 s. 1.可以转成二分图的最小点覆盖来做。不过转换后要把匹配数除以2,这个待细看。 2.也可以用树形dp c.匈牙利算法(邻接表,用vector实现): /* 用STL中的vector建立邻接表实现匈牙利算法 效率比较高 处理点比较多的效率很高。1500的点都没有问 阅读全文
posted @ 2016-03-14 16:27 gongpixin 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 总感觉有很多还不会的。。。 比如一颗树到二分图的转换,然后用匈牙利算法来解题。 这里先留着这些问题,日后再来研究。 无向图的最小路径覆盖:http://www.cnblogs.com/pushing-my-way/archive/2012/07/19/2598733.html 阅读全文
posted @ 2016-03-14 15:44 gongpixin 阅读(982) 评论(0) 推荐(0) 编辑
摘要: d. 式子B^L=N(mod P),给出B、N、P,求最小的L。 s.下面解法是设的im-j,而不是im+j。 设im+j的话,貌似要求逆元什么鬼 c. /* POJ 2417,3243 baby step giant step a^x=b(mod n) n是素数或不是素数都可以 求解上式 0<=x 阅读全文
posted @ 2016-03-11 21:22 gongpixin 阅读(311) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 50 下一页