Super Palindromes (H) 题目 Let's say a positive integer is a super-palindrome if it is a palindrome, and it is also the square of a palindrome. Given tw ...
分类:
其他好文 时间:
2021-05-24 02:27:55
阅读次数:
0
滚动数组优化dp CF570E Pig and Palindromes 原题链接 题意: 给定一个n*m(n,m ? 500)的字符矩阵,从(1,1)走到(n,m),每次只能向右和向下走,那么有多少种走法可以组成一个回文串。 思路: 由于形成的是回文串,我们可以假设有两个点,点A从(1,1)出发,点 ...
分类:
编程语言 时间:
2021-05-04 15:23:04
阅读次数:
0
先按照题目提示把回文数搞出来,然后挨个判断素数即可。 #include<iostream> #include<set> using namespace std; set<int> s; int a[10]; int m, n; int check(int t){ for(int i = 2; i < ...
分类:
其他好文 时间:
2020-10-07 21:26:21
阅读次数:
27
http://acm.hdu.edu.cn/showproblem.php?pid=6754 题意: 字符串由小写字母构成 求 长度为N的 回文子串数量最少的 字符串的个数 思路: 长度为1的串 回文子串最少1个 形式:a 长度为2的串 回文子串最少2个 形式:aa / ab 长度为3的串 回文子串 ...
分类:
其他好文 时间:
2020-07-26 00:24:53
阅读次数:
55
Java Palindrome tutorial shows how to work with palindromes in Java. Java Palindrome教程展示了如何在Java中使用回文 Palindrome is a word, number, phrase, or other s ...
分类:
编程语言 时间:
2020-07-02 14:51:38
阅读次数:
67
题意 "codechef" 做法 令$f_i$为长度为$i$的合法个数 $$f_i= f_{i 1}\times s f_{\left\lceil\frac{i}{2}\right\rceil}$$ ...
分类:
其他好文 时间:
2020-05-02 17:24:28
阅读次数:
56
题意 字符树,每个点的值为到根这个字符串最长回文串长度,求所有点权和 做法 由于PAM复杂度是均摊的,不能直接做 每次找fail时,都是找到一个最长的后缀,满足后缀前一个字符能匹配上 就记录一下节点$x$后接$c$的往上跳应该在的位置 ...
分类:
其他好文 时间:
2020-05-01 20:45:02
阅读次数:
59
"题目链接" 题目大意:给一个串的右边添加尽量少的字符,使之成为回文串。 如果一个串本身就是回文串的话,不需要添加任何字符它就是可以得到的最小的回文串了~~(废话)~~。如果需要添加字符的,这个串的右半部分必需全部都为回文串(可能就一个字符),如果不是,那么光在右边添加字符定是不够的。所以我们用马拉 ...
分类:
其他好文 时间:
2020-04-14 20:20:06
阅读次数:
69
Problem Description “回文串”是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串。请写一个程序判断读入的字符串是否是“回文”。 Input 输入包含多个测试实例,输入数据的第一行是一个正整数n,表示测试实例的个数,后面紧跟着是n个字符串。 Outpu ...
分类:
其他好文 时间:
2020-03-28 13:12:40
阅读次数:
72
题目: Returning back to problem solving, Gildong is now studying about palindromes. He learned that a palindrome is a string that is the same as its rev ...
分类:
其他好文 时间:
2020-02-20 09:39:04
阅读次数:
81