上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 23 下一页
摘要: 原题链接http://acm.hdu.edu.cn/showproblem.php?pid=3068查找字符串中最长的回文串,我们用到manachar算法。要实现manachar算法我们有有两步要做1:对字符串进行处理,把所有的字符串的长度统一化为奇数。。 1 in... 阅读全文
posted @ 2015-12-31 08:42 __NaCl 阅读(169) 评论(0) 推荐(0)
摘要: Kruskal算法的过程:(1) 将全部边按照权值由小到大排序。 (2) 按顺序(边权由小到大的顺序)考虑没条边,只要这条边和我们已经选择的边步构成圈,就保留这条边,否则放弃这条边。算法 成功选择(n-1)条边后,形成一个棵最小生成树,当然如果算法无法选择出(n-1)... 阅读全文
posted @ 2015-12-31 08:41 __NaCl 阅读(366) 评论(0) 推荐(0)
摘要: 题目链接http://acm.hnu.cn/online/?action=problem&type=show&id=13342&courseid=0 Problem description The races became more popular than ever at Pandora plan... 阅读全文
posted @ 2015-12-31 08:41 __NaCl 阅读(132) 评论(0) 推荐(0)
摘要: DescriptionMany people like to solve hard puzzles some of which may lead them to madness. One such puzzle could be finding a hidden prime number in a ... 阅读全文
posted @ 2015-12-31 08:41 __NaCl 阅读(81) 评论(0) 推荐(0)
摘要: Problem DescriptionThere are n apple trees planted along a cyclic road, which is L metres long. Your storehouse is built at position 0 on that cyclic ... 阅读全文
posted @ 2015-12-31 08:41 __NaCl 阅读(89) 评论(0) 推荐(0)
摘要: Your current task is to make a ground plan for a residential building located in HZXJHS. So you must determine a way to split the floor building wit... 阅读全文
posted @ 2015-12-31 08:41 __NaCl 阅读(118) 评论(0) 推荐(0)
摘要: 建立哈弗曼树要求我们每次都选频率权值最小的点构成节点,即权值小的点在树的深处,权值大的点在树的浅处,根据节点选择的特点,我们可以把节点的值放在优先队列中,包括新形成的节点。我们先定义优先队列的优先级别。1 struct cmp2 {3 bool operator... 阅读全文
posted @ 2015-12-31 08:41 __NaCl 阅读(114) 评论(0) 推荐(0)
摘要: http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=88791(题目连接)这道道题就是让你在大矩阵里找小矩阵,用矩阵hash用矩阵hash之前我们先定义下面这些玩意hash1[][]记录横列的的has... 阅读全文
posted @ 2015-12-31 08:41 __NaCl 阅读(133) 评论(0) 推荐(0)
摘要: http://acm.hnu.cn/online/?action=problem&type=show&id=13362&courseid=0或者是http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=7... 阅读全文
posted @ 2015-12-31 08:41 __NaCl 阅读(104) 评论(0) 推荐(0)
摘要: 1:最大公约数的求法欧几里得算法实现。递归实现 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 __int64 gcd(__int64 y,__int64 x) 7 { 8 ... 阅读全文
posted @ 2015-12-31 08:41 __NaCl 阅读(127) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 23 下一页