
字符串
文章平均质量分 62
Tao_oc
加油
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
kmp&&扩展kmp
kmp算法理解:https://www.cnblogs.com/yjiyjige/p/3263858.html next数组理解:http://www.cnblogs.com/tangzhengyue/p/4315393.html KMP算法的关键是利用匹配失败后的信息,尽量减少模式串与主串的匹配次数以达到快速匹配的目的。具体实现就是实现一个next()函数,函数本身包含了模式串的局部匹配信息...原创 2018-11-16 20:36:16 · 199 阅读 · 0 评论 -
字符串题集
2019 蓝桥杯省赛 B 组模拟赛(一) 解析: 字符串不长,最大为10 考虑map做,将字符串转化为10位以内的26进制数 对每个字符串的所有后缀对应的26进制数贡献+1,遍历输出答案 ac: #include<bits/stdc++.h> #define MAXN 100005 #define ll long long using namespace std; ma...原创 2019-03-15 23:35:31 · 215 阅读 · 0 评论 -
Clear the String(区间dp,字符串区间删除)
链接:Clear the String 题意:给个字符串,每次只能删除一段全为相同字母的区间,问删完这个字符串,最少需要多少次 解析: (1) str[i]==str[j] ,dp[i][j] = dp[i+1][j-1] + 1; (2) str[i] !=str[j] ,dp[i][j] = min( dp[i][j-1] , dp[i-1][j] )+1; (3)...原创 2019-03-09 23:58:52 · 608 阅读 · 0 评论 -
字符串
字典序:字典或词典顺序(也称为词汇顺序,字典顺序,字母顺序或词典顺序)是基于字母顺序排列的单词按字母顺序排列的方法 从头到尾依次排列,空字符最小,哪一个先小,拿一个就是字典序小 (abc)>(abd) (ab)>(aba) (abc>ac) 1.kmp&&扩展kmp https://blog.youkuaiyun.com...原创 2019-02-04 11:48:43 · 203 阅读 · 0 评论 -
神奇日期(回文串)
神奇日期 Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other) Total Submission(s) : 5 Accepted Submission(s) : 5 Font: Times New Roman | Verdana | Georgia Font Size: ← → ...原创 2018-12-13 21:50:18 · 501 阅读 · 0 评论 -
Phone List(hdu1671)
Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers: 1. Emergency 911 2. Alice 97 62...原创 2018-11-27 22:30:40 · 143 阅读 · 0 评论 -
What Are You Talking About(hdu1075)
Problem Description Ignatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when i...原创 2018-11-27 12:05:05 · 137 阅读 · 0 评论 -
hdu1251(统计难题)
统计难题 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others) Total Submission(s): 59393 Accepted Submission(s): 20705 Problem Description Ignatius...原创 2018-11-25 21:03:57 · 137 阅读 · 0 评论 -
字典树
字典树:又称单词查找树,trie树,是一种树形结构,是一种哈希树的变种。典型应用是用于统计,排序和保存大量的字符串(但不仅限于字符串),所以经常被搜索引擎系统用于文本词频统计。 它的优点是:利用字符串的公共前缀来减少查询时间,最大限度地减少无谓的字符串比较,查询效率比哈希树高 https://www.acwing.com/problem/content/144/ 题意: 给定N...原创 2018-11-25 16:58:02 · 186 阅读 · 0 评论 -
kmp&&扩展kmp题集
链接:https://vjudge.net/problem/HDU-1358 题意:给定一个串,求该串的前缀是否有循环,如果有,求循环节 解析: 直接用kmp算法求next数组,然后判断循环节 #include<bits/stdc++.h> #define N 1000025 using namespace std; int n,m; char p[N]; int next2...原创 2018-11-19 11:17:03 · 260 阅读 · 0 评论 -
字符串最小表示法&&蔡勒公式
循环字符串的最小表示法的问题可以这样描述: 对于一个字符串S,求S的循环的同构字符串S’中字典序最小的一个 1. 字符串最小表示法: int getmin(string s) { int n=s.length(); int i=0,j=1,k=0,t; while(i<n && j<n && k<n) { ...原创 2019-03-15 23:07:22 · 208 阅读 · 0 评论