码迷,mamicode.com
首页 >  
搜索关键字:palindrome    ( 1561个结果
Codeforces Round #636 (Div. 3)
题目链接:https://codeforces.com/contest/1343 A Candies 随便做做。 B Balanced Array 随便做做。 D Constant Palindrome Sum 题意:如题目的名字,给一个 $n$ 个数字的数组,要保持对称位置的和恒为常数,但是每个数 ...
分类:其他好文   时间:2020-04-22 09:23:49    阅读次数:69
字符串hash+二分答案
字符串hash+二分答案 "Palindrome poj 3974" 求一个字符串的最长回文子串。 因为在学字符串hash,所以这里用二分答案和字符串hash来做,复杂度是O(N log N),据说manacher算法可以在O(N)解决这个问题,但是我还没学哈哈哈哈以后补吧 题解:枚举回文子串的中心 ...
分类:其他好文   时间:2020-04-20 21:27:55    阅读次数:60
Codeforces Global Round 7 D2. Prefix-Suffix Palindrome (Hard version)(Manacher算法+输出回文字符串)
This is the hard version of the problem. The difference is the constraint on the sum of lengths of strings and the number of test cases. You can make ...
分类:编程语言   时间:2020-04-18 14:10:40    阅读次数:87
CF-div3-635-E - Three Blocks Palindrome| 二分
代码 ...
分类:其他好文   时间:2020-04-15 15:11:50    阅读次数:47
codeforces-1335-E Three Blocks Palindrome
codeforces-1335-E Three Blocks Palindrome 传送门: easy:https://codeforces.com/contest/1335/problem/E1 hard:https://codeforces.com/contest/1335/problem/E2 ...
分类:其他好文   时间:2020-04-14 22:44:12    阅读次数:74
CF1335E Three Blocks Palindrome
就是我这个菜鸡,赛时写出了 E2 的做法,但是算错复杂度,导致以为自己的做法只能AC E1,就没交到 E2 上,然后赛后秒A..... 题意 定义一种字串为形如:$[\underbrace{a, a, \dots, a}_{x}, \underbrace{b, b, \dots, b}_{y}, \ ...
分类:其他好文   时间:2020-04-14 12:23:10    阅读次数:63
Codeforces 1335E1 - Three Blocks Palindrome (easy version)
题面 题意 给定一个长度为 n 的数列 定义要求的回文子数列满足下图条件 其中 x 与 y 可以为 0 即这个回文子数列可以是 数字完全相同 的一个子数列 也可以是 只包含两种数字 ,且其中一种 平均分布 在另一种数字的两侧 求出最长的回文子数列长度 解题思路 在输入时往vector里记录下每个数字 ...
分类:其他好文   时间:2020-04-14 09:15:49    阅读次数:62
Codeforces 1335E2 - Three Blocks Palindrome (hard version)
题面 题意/解题思路 直接延用 Easy 版本的想法即可 详解见上一篇博客 "Codeforces 1335E1 Three Blocks Palindrome (easy version)" 完整程序 (93ms/2000ms) c++ include using namespace std; i ...
分类:其他好文   时间:2020-04-14 09:13:15    阅读次数:59
ccpc2017杭州
solve A B C D E F G H I J K L 5/12 ac ac ac ac ac try A - Super-palindrome 题意 : 一个字符串,每个子串都要是回文的,问你最少翻几个。 如果每一个字符串都是回文串,那么最终奇数位等于奇数位,偶数位等于偶数位, #includ ...
分类:其他好文   时间:2020-04-09 00:38:31    阅读次数:101
LeetCode 564. Find the Closest Palindrome (构造)
题意: 给一个数字n 求离n最近(且不等)的回文串 存在多个答案返回最小的 首先很容易想到 将数字分为两段,如 12345 -> 123/45,然后将后半段根据前面的进行镜像重置 123/45 -> 12321 那,如果数字刚好是回文串,就把前半段-1就好了 但是存在以下例外,就是当前半段 +1 或 ...
分类:其他好文   时间:2020-04-06 15:59:20    阅读次数:64
1561条   上一页 1 ... 3 4 5 6 7 ... 157 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!