字符处理
Frontier_Setter
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
USACO 5.5.2 Hidden Password
http://train.usaco.org/usacoprob2?a=qNexyVCSx2z&S=hidden题目大意:一个字符串循环左移,找到字典序最小时的开头字母的编号(0-L-1)原本想枚举每种情况然后比较,果不其然在10000个a的样例上就超时了,心知肚明把它作为特殊情况继续优化没意义就另寻出路看了题解才知道原来是一道裸的字符串匹配算法题(字符串的最小表示法)i:起匹位置1,j:...原创 2018-02-09 20:04:06 · 264 阅读 · 0 评论 -
USACO 6.2.1 Calf Flac 马拉车算法(Manacher's Algorithm)
http://train.usaco.org/usacoprob2?a=Hfv8bxVT1Ac&S=calfflac题目大意:一串字符串(不超过200000个字符),求最长回文子串(不考虑非字母字符),并输出这一段(要包含非字母字符,包括换行符)裸的最大回文子串题,直接用马拉车算法可解:※马拉车算法讲解可参考:https://www.cnblogs.com/grandyang/p/4475...原创 2018-02-11 22:15:44 · 481 阅读 · 0 评论 -
USACO 6.3.2 Cryptcowgraphy 剪枝
http://train.usaco.org/usacoprob2?a=Bc6YOT0fW9R&S=cryptcow题目大意:字符串解码,字符串中分布有(C,O,W),每一步交换C-O, O-W中的子串,看能否最后达到目标字符串,如可以输出步数(目标字符串给出,且不含C,O,W)字符串处理+搜索剪枝①最直观的剪枝就是当前字符串中不含COW的前后缀必须要和目标串匹配,但仅仅如此肯定是过不了的...原创 2018-02-13 18:02:54 · 351 阅读 · 0 评论 -
[LeetCode] (medium) 8. String to Integer (atoi)
https://leetcode.com/problems/string-to-integer-atoi/Implement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first no...原创 2019-02-02 01:33:40 · 149 阅读 · 0 评论 -
[LeetCode] (medium) 227. Basic Calculator II
https://leetcode.com/problems/basic-calculator-ii/Implement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, / operato...原创 2019-02-17 18:01:48 · 170 阅读 · 0 评论 -
[LeetCode] (medium) 241. Different Ways to Add Parentheses
https://leetcode.com/problems/different-ways-to-add-parentheses/Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers ...原创 2019-03-21 11:25:46 · 224 阅读 · 0 评论 -
[LeetCode] (medium) 402. Remove K Digits
https://leetcode.com/problems/remove-k-digits/Given a non-negative integernumrepresented as a string, removekdigits from the number so that the new number is the smallest possible.Note:The ...原创 2019-04-29 17:32:28 · 165 阅读 · 0 评论 -
[LeetCode] (hard) 10. Regular Expression Matching && 44. Wildcard Matching
10.Regular Expression MatchingGiven an input string (s) and a pattern (p), implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero ...原创 2019-06-02 18:16:10 · 251 阅读 · 0 评论
分享