码迷,mamicode.com
首页 >  
搜索关键字:palindromes    ( 345个结果
洛谷 P1207 [USACO1.2]双重回文数 Dual Palindromes
题目描述 如果一个数从左往右读和从右往左读都是一样,那么这个数就叫做“回文数”。例如,12321就是一个回文数,而77778就不是。当然,回文数的首和尾都应是非零的,因此0220就不是回文数。 事实上,有一些数(如21),在十进制时不是回文数,但在其它进制(如二进制时为10101)时就是回文数。 编 ...
分类:其他好文   时间:2017-08-29 23:43:35    阅读次数:208
poj3376 KMP+字典树求回文串数量(n*n)
Finding Palindromes Time Limit: 10000MS Memory Limit: 262144K Total Submissions: 4043 Accepted: 746 Case Time Limit: 2000MS Description A word is call ...
分类:其他好文   时间:2017-08-21 00:11:45    阅读次数:495
9. Palindrome Number 回文 my second leetcode 20170807
Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be palindromes? ...
分类:其他好文   时间:2017-08-08 00:43:19    阅读次数:199
Partitioning by Palindromes UVA - 11584
题意:输入一个由小写字母组成的字符串,你的任务是把它划分成尽量少的回文串。 题解:d(i)为字符0~i划分成的最小回文串的个数,则d[ i ]=min{ d[ j ]+1 |s[ j+1~ i ]是回文串 }。 注意要预处理,其次是怎么初始化。。。很重要 ...
分类:其他好文   时间:2017-08-07 13:28:53    阅读次数:113
Partitioning by Palindromes UVA - 11584 动态规划
题意是给定一个字符串,求最少把它分成多少份,使的每一份都是回文串。 错了好多遍,最后发现是贪心思路出了问题,一开始求出dp[i][j],dp[i][j]表示第i个到第j个这段子串是否是回文串,求出来后,我直接从1开始遍历,每次求最右边的,这种贪心思路是有问题的。 看了赛后别人的才知道可以同动态规划, ...
分类:其他好文   时间:2017-08-03 18:47:42    阅读次数:120
ecjtu-summer training #12
A - The Trip, 2007 小包可以放在打包里,求最少的数量。 做法就是求出现相同数字最多的。 B - Partitioning by Palindromes 传送 C - Seek the Name, Seek the Fame The little cat is so famous, ...
分类:其他好文   时间:2017-08-03 18:09:44    阅读次数:130
Codeforces Round #360 B
Lovely Palindromes 题意:给一个n,求第n大的长度为偶数的回文数字 思路:只考虑回文的前一半数字,因为前面是高位,肯定优先满足高位,第n大是数字就是n,后半部分由回文自动满足得到,所以其实就是正着输出一遍,倒着再输出一遍 AC代码: ...
分类:其他好文   时间:2017-07-31 19:57:43    阅读次数:155
CF 316div2 E.Pig and Palindromes
E. Pig and Palindromes Peppa the Pig was walking and walked into the forest. What a strange coincidence! The forest has the shape of a rectangle, cons ...
分类:其他好文   时间:2017-07-29 18:58:41    阅读次数:163
POJ 3376 Finding Palindromes
http://poj.org/problem?id=3376 Finding Palindromes Time Limit: 10000MS Memory Limit: 262144K Total Submissions: 3973 Accepted: 726 Case Time Limit: 20 ...
分类:其他好文   时间:2017-07-10 12:00:02    阅读次数:185
EularProject 36:2进制和10进制回文数
华电北风吹 天津大学认知计算与应用重点实验室 完毕日期:2015/7/29 Double-base palindromes Problem 36 The decimal number, 585 = 10010010012 (binary), is palindromic in both bases. ...
分类:其他好文   时间:2017-07-01 15:25:35    阅读次数:134
345条   上一页 1 ... 7 8 9 10 11 ... 35 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!