A palindromic number or numeral palindrome is a ‘symmetrical’ number like 16461 that remains the same when its digits are reversed. In this problem yo ...
分类:
其他好文 时间:
2017-08-20 18:20:45
阅读次数:
161
题意:输入L,R,l,r求[L,R]范围内在[l, r]进制下的回文数(2<=l<=r<=26, L<=R<1e9) ...
分类:
其他好文 时间:
2017-08-20 12:23:44
阅读次数:
105
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=6156 题目描述: 求L~R所有的数的l~r进制的f(x), f(x) = 当前进制 如果回文串, f(x) = 1 其他情况 解题思路: 数位DP, 统计个数 , 需要作出改变的就是进制和回文 代码: ...
分类:
其他好文 时间:
2017-08-20 00:43:47
阅读次数:
251
题目链接:hdu 6156 Palindrome Function 题意: 给你一个L,R,l,r,问你在[L,R]内在[l,r]进制下有多少数是回文数,然后算一算贡献。 题解: 由于答案和该回文数的最高位有关(因为前导0不算)。 考虑dp[i][j][k],表示在i进制下,当前考虑到第j位,该数字 ...
分类:
其他好文 时间:
2017-08-19 22:24:57
阅读次数:
165
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6156 题意:算十进制下数字在[L,R]内用[l,r]进制表述下的数字贡献。 贡献有两种:回文数,贡献是进制k;不是回文数,贡献是1。 由于进制只有36个,枚举进制分别做统计回文数的数位dp即可,贡献按要 ...
分类:
其他好文 时间:
2017-08-19 22:19:32
阅读次数:
158
Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For exampl ...
分类:
其他好文 时间:
2017-08-18 22:36:31
阅读次数:
149
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1513 题意: 给你一个字符串s,你可以在s中的任意位置添加任意字符,问你将s变成一个回文串最少需要添加字符的个数。 题解1(LCS): 很神奇的做法。 先求s和s的反串的LCS,也就是原串中已经满足回文 ...
分类:
其他好文 时间:
2017-08-16 23:22:46
阅读次数:
422
传送门 Description Determine whether an integer is a palindrome. Do this without extra space. Determine whether an integer is a palindrome. Do this witho ...
分类:
其他好文 时间:
2017-08-14 01:25:39
阅读次数:
121
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1513 题目大意:给一个字符串,问最少加多少个字母能成为回文串。 关键思想:要解决的是回文子序列问题而不是回文子串。回文子序列怎么求?可以把字符串倒转一下,再求他们的最长公共子序列啊!想一想为什么。求出L ...
分类:
其他好文 时间:
2017-08-12 21:15:03
阅读次数:
175
题目:Palindrome Pairs Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two wo ...
分类:
其他好文 时间:
2017-08-10 23:36:23
阅读次数:
162