P1217 [USACO1.5]回文质数 Prime Palindromes 题意:给定一个区间,输出其中的回文质数; 学习了洛谷大佬的回溯写法,感觉自己写回溯的能力不是很强; ...
分类:
其他好文 时间:
2018-02-17 21:43:55
阅读次数:
234
【题目描述】 输入一个字符串,判断它是否为回文串以及镜像串。输入字符串保证不含数字0.所谓回文串,就是反转以后和原串相同,如abba和madam。所有镜像串,就是左右镜像之后和原串相同,如2S和3AIAE。注意,并不是每个字符在镜像之后都能得到一个合法字符。在本题中,每个字符的镜像如图所示(空白项表 ...
分类:
其他好文 时间:
2018-02-16 13:01:51
阅读次数:
192
2018.2.4 P1217【USACO1.5]回文质数 Prime Palindromes】 2018.2.6 P1308 【统计单词数】 链接 持续更新中 ...
分类:
其他好文 时间:
2018-02-07 14:35:36
阅读次数:
120
UVa-401 Palindromes Description A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string " ...
分类:
其他好文 时间:
2018-02-02 20:17:22
阅读次数:
179
题解 P1217 【[USACO1.5]回文质数 Prime Palindromes】 蒟蒻对这题的思路很简单,懒得想太多复杂的细节,先打一个O(n)的暴力算法,再一次像下方粘的代码这样输出 其实很多时候,考试的时候,遇到这类的题没有必要想进一切可能,思考,钻研。抑或是觉得自己的代码可能AC不了会T ...
分类:
其他好文 时间:
2018-02-01 23:11:52
阅读次数:
158
题目: Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. ...
分类:
其他好文 时间:
2018-01-29 17:35:00
阅读次数:
145
【题目】E. Palindromes in a Tree 【题意】给定一棵树,每个点都有一个a~t的字符,一条路径回文定义为路径上的字符存在一个排列构成回文串,求经过每个点的回文路径数。n<=2*10^5。 【算法】点分治 【题解】状压20位的二进制表示一条路径的字符状态,点分治过程中维护扫描过的路 ...
分类:
其他好文 时间:
2018-01-23 10:47:19
阅读次数:
272
题目链接:http://codeforces.com/problemset/problem/245/H 题意: 给你一个字符串s。 然后有t个询问,每个询问给出x,y,问你区间[x,y]中的回文子串的个数。 题解: 表示状态: dp[x][y] = numbers 表示区间[x,y]中的回文子串个数 ...
分类:
其他好文 时间:
2018-01-05 15:14:57
阅读次数:
144
Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thi ...
分类:
其他好文 时间:
2017-12-27 14:29:30
阅读次数:
113
题目描述 因为151既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以 151 是回文质数。 写一个程序来找出范围[a,b](5 <= a < b <= 100,000,000)( 一亿)间的所有回文质数; 输入输出格式 输入格式: 第 1 行: 二个整数 a 和 b . 输出格式: ...
分类:
其他好文 时间:
2017-12-03 16:33:27
阅读次数:
216