题目 Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are ...
分类:
其他好文 时间:
2017-05-12 20:13:53
阅读次数:
200
题目:统计一个串中的回文子串的个数(注意是子串,要连续)。 分析:dp。暴力。直接用dp,二维数组内存不够用,并且dp木有暴力快( ⊙ o ⊙ )啊! 说明:(2011-09-24 03:22)。 #include <iostream> #include <cstdlib> #include <cs ...
分类:
其他好文 时间:
2017-05-04 14:41:16
阅读次数:
134
// uva 11584 Partitioning by Palindromes 线性dp // // 题目意思是将一个字符串划分成尽量少的回文串 // // f[i]表示前i个字符能化成最少的回文串的数目 // // f[i] = min(f[i],f[j-1] + 1(j到i是回文串)) // ...
分类:
其他好文 时间:
2017-04-22 09:32:10
阅读次数:
122
1167: 零起点学算法74——Palindromes _easy version Description “回文串”是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串。请写一个程序判断读入的字符串是否是“回文”。 “回文串”是一个正读和反读都一样的字符串,比如“lev ...
分类:
编程语言 时间:
2017-04-10 00:30:40
阅读次数:
263
题目链接:http://poj.org/problem?id=3376 未解决!!! 下面代码明显会TLE-_-|| 新的方法还不理解以后再看。 ...
分类:
其他好文 时间:
2017-03-25 00:02:50
阅读次数:
201
题目: Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. ...
分类:
其他好文 时间:
2017-03-24 10:32:02
阅读次数:
125
1.Factorialize a Number 计算一个整数的阶乘 2.Check for Palindromes 检查字符串是否是回文 3.Find the Longest Word in a String 找到句子中最长单词,并计算其长度 ...
分类:
其他好文 时间:
2017-03-10 13:22:02
阅读次数:
151
A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome becau ...
分类:
其他好文 时间:
2017-03-10 13:12:58
阅读次数:
270
题意:给定一个字符串,求出它最少可分成几个回文串。 析:dp[i] 表示前 i 个字符最少可分成几个回文串,dp[i] = min{ 1 + dp[j-1] | j-i是回文}。 代码如下: ...
分类:
其他好文 时间:
2017-01-12 15:06:17
阅读次数:
141