(Message App)The app just take the last 7 digits from a contact, then it does not create a converstion with the name of the contact that you are texti...
分类:
其他好文 时间:
2014-07-16 21:43:29
阅读次数:
203
#include#includevoid getNext(int *Next,char* src){ int i,j; Next[0]=-1; i=0; j=-1; int N=strlen(src); while(i<N-1){ if(j==-1||src[i]==src[j]){ ++i;...
分类:
其他好文 时间:
2014-07-16 21:33:22
阅读次数:
222
字符串朴素匹配法相等情况int index(const char * str1, const char * str2, int pos){ int i = pos; int j = 0; while(i = strlen(str2)) // matched and retu...
分类:
其他好文 时间:
2014-07-14 09:00:51
阅读次数:
176
All in All题意:字符串匹配#include #include char S[200000];char P[200000];int next[200000];int KMP(int pos, int len1, int len2){ int i = pos, j = 1, k = 0;...
分类:
其他好文 时间:
2014-07-13 20:09:39
阅读次数:
175
^行首定位符^love匹配所有以love开头的行$行尾定位符love$匹配所有以love结尾的行.单个任意字符l..e匹配以l开始后跟两个字符再跟一个e的字符串*重复0到多个星号前面的字符a*匹配0个或多个a的字符串[]匹配一组字符的任意一个[Ll]ove匹配Love或love的字符串[x-y]匹配指定范围的一..
分类:
其他好文 时间:
2014-07-13 14:13:13
阅读次数:
308
[\u4e00-\u9fa5]//匹配中文字符^[1-9]\d*$//匹配正整数^[A-Za-z]+$//匹配由26个英文字母组成的字符串^[A-Z]+$//匹配由26个英文字母的大写组成的字符串^[a-z]+$//匹配由26个英文字母的小写组成的字符串^[A-Za-z0-9]+$//匹配由数字和2...
分类:
其他好文 时间:
2014-07-13 12:10:35
阅读次数:
233
题目:hdu4847:Wow! Such Doge!
题目大意:在给出的段落里面找出“doge”大小写都可以。
解题思路:字符串匹配问题,可以在之前将字母都转换成统一格式。
代码:
#include
#include
const int N = 1e6;
char str[N];
const char *s1 = "doge";
int find () {
i...
分类:
其他好文 时间:
2014-07-10 19:32:46
阅读次数:
224
后缀自动机(sam)上的字符串匹配
====
我们把相对较短的模式串构造成sam。
对于P="abcabcacab", T[1..i]的后缀,使得它是sam的最长前缀长度:
T: b a b c b a b c a b c a a b c a b c a b c a c a b c
1 1 2 3 1 1 2 3 4 5 6 7 1 2 3 4 5 6 7 5 6 7 8 9 1...
分类:
其他好文 时间:
2014-07-09 09:38:32
阅读次数:
162
类似于字符串的匹配,我们总是找到第一个匹配的字符,在继续比较以后的字符是否全部相同,如果匹配串的第一个字符与模式串的第一个不相同,我们就去查看匹配串的下一个字符是否与模式串的第一个相同,对应到这里,就是我们要遍历root1,找到与root2相同的第一个结点,若root1的根不相同,那么我们查找其左子树是否有第一个相同的,相同的操作再去看右子树是否有相同的第一个,若找到了第一个相同的,与字符串匹配思...
分类:
其他好文 时间:
2014-07-08 20:43:26
阅读次数:
216
题目:10340 - All in All
题目大意:给出字符串s和t,问s是否是t的子串。s若去掉某些字符能和t一样,那么t是s的子串。
解题思路:匹配字符。t的每个字符和s中的字符匹配。注意这里的字符数组大小要开大点。
代码:
#include
#include
const int N = 1000005;
char s[N], t[N];
bool m...
分类:
其他好文 时间:
2014-07-06 00:20:23
阅读次数:
363