UVa11584Partitioning by Palindromes(字符串区间dp)
题意:给定一个字符串s, 问说最少可以划分成几个回文串。
思路:dp[i]表示从1到第i个字符最少可以划分为几个回文,状态转移方程
dp[i] = min(dp[i], dp[j-1]+1), 如果满足 s[j] 到 s[i] 为回文字符串。...
分类:
其他好文 时间:
2015-04-28 23:04:13
阅读次数:
274
题目:
Determine whether an integer is a palindrome. Do this without extra space.
Some hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of converting the integer to s...
分类:
其他好文 时间:
2015-04-28 22:53:01
阅读次数:
177
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1544问题分析:问题要求求出字符串的连续子串中的回文子串个数。首先,需要区分连续子串与子序列的区别。连续子串为连续的字符组成的字符串;子序列需要满足在子序列中出现的字符的相对顺序与字符串中出现的相对顺序相...
分类:
其他好文 时间:
2015-04-26 22:43:22
阅读次数:
218
问题描述:Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are t...
分类:
编程语言 时间:
2015-04-25 14:54:15
阅读次数:
167
Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)...
分类:
其他好文 时间:
2015-04-21 20:22:35
阅读次数:
130
Palindromes _easy version
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 26800 Accepted Submission(s): 16271
Problem Description...
分类:
其他好文 时间:
2015-04-19 19:32:14
阅读次数:
129
看上去像是回文串自动机的模板题,就来了一发
The Number of Palindromes
Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 1992 Accepted Submission(s): 694...
分类:
其他好文 时间:
2015-04-17 11:26:22
阅读次数:
160
题目:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes?...
分类:
其他好文 时间:
2015-04-15 23:20:59
阅读次数:
159
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i...
分类:
其他好文 时间:
2015-04-15 21:25:08
阅读次数:
112
把所有符合条件的数全部记下来,扫一遍就行了,这类数最多2W来个
/*
ID: 18906421
LANG: C++
PROG: pprime
*/
#include
#include
#include
#include
using namespace std;
const int maxn = 20005;
int a,b;
int cnt = 0;
int prime[maxn];
bool ...
分类:
其他好文 时间:
2015-04-14 21:34:36
阅读次数:
164