2012年4月1日

HDU 1686 Oulipo

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1686大意:求模式串在主串出现的次数。。(可以重复)#include <iostream>#include <string>using namespace std;const int L1 = 1000010;const int L2 = 10010;char s[L1], p[L2];int nxt[L2], l1, l2;int res;void GetNext(){ int k = -1, j = 0; nxt[0] = -1; while (j < l2) { .. 阅读全文

posted @ 2012-04-01 17:55 [S*I]SImMon_WCG______* 阅读(183) 评论(0) 推荐(0) 编辑

HDU 1711 Number Sequence

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1711把字符数组转成整形数组。。。然后我们本来是从0开始的,,,他要的是从1开始。。。。。#include <iostream>#include <string>using namespace std;const int L1 = 1000010;const int L2 = 10010;int s[L1], p[L2];int nxt[L2], l1, l2;int res;void GetNext(){ int k = -1, j = 0; nxt[0] = -1; whil 阅读全文

posted @ 2012-04-01 17:42 [S*I]SImMon_WCG______* 阅读(188) 评论(0) 推荐(0) 编辑

HDU 2087 剪花布条(第一道KMP题)

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=2087#include <iostream>#include <string>using namespace std;#define L1 1001#define L2 1001char s[L1], p[L2];int nxt[L2], l1, l2;int res;void GetNext(){ int k = -1, j = 0; nxt[0] = -1; while (j < l2) { if (k == -1 || p[j] == p[k]) ... 阅读全文

posted @ 2012-04-01 16:39 [S*I]SImMon_WCG______* 阅读(178) 评论(0) 推荐(0) 编辑

导航