链接:http://acm.hdu.edu.cn/showproblem.php? pid=1143 Tri Tiling Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2799 Accepted Submission(s): 1585 Problem Description In how many ways can you tile a…
Tri Tiling Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2118 Accepted Submission(s): 1211 Problem Description In how many ways can you tile a 3xn rectangle with 2x1 dominoes? Here is a sa…
HDU 5860 Death Sequence(递推) 题目链接http://acm.split.hdu.edu.cn/showproblem.php?pid=5860 Description You may heard of the Joseph Problem, the story comes from a Jewish historian living in 1st century. He and his 40 comrade soldiers were trapped in a cave…
题目的匹配应该也要看成一个文本串与另一个模式串的匹配过程 Text是以当前i结尾的后缀来匹配Pattern的前缀(非真) 这里的Pattern肯定是可以匹配成功的,直接由next来保证(next总是当前结尾的最大前缀,恰好满足递推的需要) (说的不是很准确,就是kmp匹配过程时使用的方法) 举个栗子: a b a b a c b a 0 0 1 2 3 0 0 1 next 1 1 1 1 1 1 1 1 dp 初始合法状态 1 1 2 2 3 1 1 2 dp 最终计算结果 dp[1] = 1…