码迷,mamicode.com
首页 >  
搜索关键字:palindrome    ( 1561个结果
409. Longest Palindrome
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This ...
分类:其他好文   时间:2017-11-05 11:27:28    阅读次数:134
【Atcoder】CODE FESTIVAL 2017 qual C D - Yet Another Palindrome Partitioning
【题意】 给定只含小写字母的字符串,要求分割成若干段使段内字母重组顺序后能得到回文串,求最少分割段数。n<=2*10^5 【题解】 关键在于快速判断一个字符子串是否合法,容易发现合法仅当不存在或只存在一个奇数字符,其余字符均为偶数。 当涉及到奇偶性(%2)时,很自然能想到异或。 将小写字母a~z转化 ...
分类:其他好文   时间:2017-11-04 17:54:54    阅读次数:144
并查集 专题总结
一.题目类型: 1.普通并查集: poj2513 Colored Sticks hdu1198 Farm Irrigation SCAU 1138 代码等式 Gym - 100676F Palindrome Codeforces Round #363 (Div. 2) D. Fix a Tree C ...
分类:其他好文   时间:2017-11-04 16:28:20    阅读次数:138
atcoder CODE FESTIVAL 2017 qual C D - Yet Another Palindrome Partitioning
Problem Statement We have a string s consisting of lowercase English letters. Snuke is partitioning s into some number of non-empty substrings. Let th ...
分类:其他好文   时间:2017-11-03 22:03:57    阅读次数:273
【POJ】3280 Cheapest Palindrome(区间dp)
Cheapest Palindrome Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10943 Accepted: 5232 Description Keeping track of all the cows can be a ...
分类:其他好文   时间:2017-11-03 21:52:22    阅读次数:181
[LeetCode] Palindrome Linked List
Given a singly linked list, determine if it is a palindrome. Follow up:Could you do it in O(n) time and O(1) space? 判断回文链表 思路:由于链表无法像数组、字符串一样直接定位到中间索引 ...
分类:其他好文   时间:2017-11-03 13:02:37    阅读次数:124
【Codeforces748D】Santa Claus and a Palindrome [STL]
Santa Claus and a Palindrome Description 有k个串,串长都是n,每个串有一个ai的贡献。 选出若干个串,若它们可以通过任意组合,形成一个回文串,则可以获得它们的贡献之和。 求最大贡献。 Input 第一行两个整数k,n。 之后k行,每行分别是一个串si,与贡献 ...
分类:其他好文   时间:2017-11-01 16:31:39    阅读次数:161
[LeetCode] 125. Valid Palindrome Java
题目: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: ...
分类:编程语言   时间:2017-11-01 11:08:57    阅读次数:134
Atcoder Yet Another Palindrome Partitioning(状压dp)
Atcoder Yet Another Palindrome Partitioning 思路: 一个字符串满足条件的情况是奇数字母个数小于等于1,也就是异或起来是1<<j(0<=j<=25) 记mark是异或起来的值 状态转移: dp[mark]=dp[mark]+1; dp[mark]=min(d ...
分类:其他好文   时间:2017-11-01 11:06:24    阅读次数:155
234. Palindrome Linked List
234. Palindrome Linked List Given a singly linked list, determine if it is a palindrome. ...
分类:其他好文   时间:2017-10-29 19:32:04    阅读次数:176
1561条   上一页 1 ... 36 37 38 39 40 ... 157 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!