Prime Palindrome GolfDo you know how to play Prime Palindrome Golf? You are given a number and your challenge is to find the closest palindromic prime...
分类:
其他好文 时间:
2014-08-05 13:24:49
阅读次数:
274
题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique lo....
分类:
编程语言 时间:
2014-08-04 04:10:26
阅读次数:
374
LightOJ 1205 - Palindromic Numbers (数位dp)
ACM
题目地址:SPOJ MYQ10 Mirror Number
题意:
求[a,b]中回文的个数。
分析:
是SPOJ MYQ01的简单版...其实有非递归方法的。
代码:
/*
* Author: illuz
* Blog: http:...
分类:
其他好文 时间:
2014-08-02 20:56:24
阅读次数:
218
有一个比较容易出错的点:反转求最长公共子序列,这是错误的想法 1 class Solution { 2 public: 3 string longestPalindrome(string s) { 4 int n = s.length(); 5 int lon...
分类:
其他好文 时间:
2014-08-01 15:28:31
阅读次数:
214
Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there...
分类:
其他好文 时间:
2014-08-01 04:47:25
阅读次数:
243
E -Palindromic NumbersTime Limit:2000MSMemory Limit:32768KB64bit IO Format:%lld & %lluDescriptionA palindromic number or numeral palindrome is a 'symm...
分类:
其他好文 时间:
2014-07-31 23:36:50
阅读次数:
360
数位DP。。。。
Palindromic Numbers
Time Limit: 2000MS
Memory Limit: 32768KB
64bit IO Format: %lld & %llu
[Submit] [Go Back] [Status]
Description
A palindro...
分类:
其他好文 时间:
2014-07-31 03:04:56
阅读次数:
247
如果一个字符串从左向右写和从右向左写是一样的,这样的字符串就叫做palindromic string,如aba,或者abba。本题是这样的,给定输入一个字符串,要求输出一个子串,使得子串是最长的padromic string。
下边演示3种思路
1.两侧比较法
以abba这样一个字符串为例来看,abba中,一共有偶数个字,第1位=倒数第1位,第2位=倒数第2位......第N位=倒数第...
分类:
编程语言 时间:
2014-07-08 17:49:03
阅读次数:
238
Given a string S,
find the longest palindromic substring in S.
You may assume that the maximum length of S is
1000, and there exists one unique longest palindromic substring.
给定一个字符串S,找出其中的最长回文...
分类:
其他好文 时间:
2014-07-06 00:15:15
阅读次数:
240
链接:http://vjudge.net/problem/viewProblem.action?id=19602描述:给出一个字符串,求重新排列后第n个回文串,若没有则输出”XXX“。思路:组合数问题。 首先考虑什么时候有回文串。很简单,数量为奇数的字母不超过1个。且这个字母只能是在字符串的中...
分类:
其他好文 时间:
2014-07-01 17:12:53
阅读次数:
249