码迷,mamicode.com
首页 >  
搜索关键字:e pig and palindrome    ( 2194个结果
【leetcode】1328. Break a Palindrome
题目如下: Given a palindromic string palindrome, replace exactly one character by any lowercase English letter so that the string becomes the lexicographi ...
分类:其他好文   时间:2020-01-27 19:23:10    阅读次数:72
PAT Advanced 1136 A Delayed Palindrome (20分)
Consider a positive integer N written in standard notation with k+1 digits a?i?? as a?k???a?1??a?0?? with 0 for all i and a?k??>0. Then N is palindrom ...
分类:其他好文   时间:2020-01-27 17:31:19    阅读次数:64
leetcode1328
1 class Solution: 2 def breakPalindrome(self, palindrome: str) -> str: 3 n = len(palindrome) 4 if n <= 1: 5 return '' 6 half = n // 2 7 sub = palindro ...
分类:其他好文   时间:2020-01-26 10:23:29    阅读次数:62
[Algorithm] 234. Palindrome Linked List / Reverse linked list
Given a singly linked list, determine if it is a palindrome. Example 1: Input: 1->2 Output: false Example 2: Input: 1->2->2->1 Output: true /** * Defi ...
分类:其他好文   时间:2020-01-23 09:28:20    阅读次数:63
Luogu P2482 [SDOI2010]猪国杀
"Pig Country Kill" 很古怪的翻译,不过它确实叫猪(Pig)国(Country)杀(Kill)。 我们来好好整理一下这道题目。题面虽较长,但内容基本清晰,只是有部分很Pig的操作部分,很容易让第一次看见这道题目的人百思不得其解。 先整理一下这道长长的题面。 First:人物 四位玩家 ...
分类:其他好文   时间:2020-01-22 21:33:02    阅读次数:78
挑战程序设计竞赛2.3习题:Cheapest Palindrome POJ - 3280
Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID ...
分类:其他好文   时间:2020-01-22 20:05:48    阅读次数:73
ARTS-week10
Algorithm 判断一个整数是否是回文数。回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数。 [Palindrome Number]( https://github.com/felixzfq/leetcode/blob/master/algorithms/python/Palindr ...
分类:其他好文   时间:2020-01-20 22:36:17    阅读次数:103
[算法模版]回文树
回文树 本文全文引自 "yijan" ,特此鸣谢。 回文树,也就是回文自动机,PAM(Palindrome automaton) 是一个处理回文串的有力工具。然而这个东西比SAM简单多了。。 (它可能比 manacher 要强得多?) 回文自动机有两个根,也就是说其实是有两个树的,一个存储长度为奇数 ...
分类:编程语言   时间:2020-01-18 21:23:12    阅读次数:85
[LeetCode] 9. Palindrome Number
回文数。题意是判断一个数字是否是回文数。这个题跟第7题非常类似,几乎是一样的做法。例子, Example 1: Input: 121 Output: true Example 2: Input: -121 Output: false Explanation: From left to right, ...
分类:其他好文   时间:2020-01-16 14:55:14    阅读次数:89
[LeetCode] 125. Valid Palindrome
有效的回文。题意很简单,验证给的input是否是一个有效的回文。例子, Example 1: Input: "A man, a plan, a canal: Panama" Output: true Example 2: Input: "race a car" Output: false 思路也很简 ...
分类:其他好文   时间:2020-01-15 09:24:11    阅读次数:51
2194条   上一页 1 ... 11 12 13 14 15 ... 220 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!