E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
3461
PKU
3461
Oulipo
OulipoTimeLimit:1000MSMemoryLimit:65536KTotalSubmissions:31546Accepted:12735DescriptionTheFrenchauthorGeorgesPerec(1936–1982)oncewroteabook,Ladisparition,withouttheletter‘e’.HewasamemberoftheOulipogro
DCrusher
·
2016-01-03 15:07
KMP
poj
3461
Oulipo KMP算法
题目:给出一个单词w和一篇文章t,求该单词在文章中出现了多少次(可以有重叠部分)。分析:很裸的KMP算法,现求出w的next数组,再进行匹配,匹配次数即为答案。下面附程序:var w,t:ansistring; lenw,lent,i,n,j,l,ans:longint; next:array[0..10000]oflongint; procedureget; var i,j:longint;
qq_33229466
·
2015-12-26 10:00
KMP算法--poj
3461
#include#include#defineN1000005chart[N],w[10005];//t为主串,w为模式串 inti,j,next[10005],sum,l;//计算next函数,用的方法是最优化的 voidget_next(){ next[0]=-1;i=0;j=-1;while(w[i]){if(j==-1||w[i]==w[j]){i++;j++;if(w[i]!=w[j]
qq_27717967
·
2015-12-23 15:00
poj
3461
KMP算法的应用
//============================================================================ // //>File:poj2406.cpp //>Author:flowertree //>Time:2015年12月15日 //>Algorithm:KMPnext数组的应用 // //==========================
fuyan159357
·
2015-12-15 21:00
KMP
poj
poj
3461
Oulipo
OulipoTimeLimit: 1000MS MemoryLimit: 65536KTotalSubmissions: 31293 Accepted: 12643DescriptionTheFrenchauthorGeorgesPerec(1936–1982)oncewroteabook,Ladisparition,withouttheletter 'e'.HewasamemberoftheOu
AaronGZK
·
2015-12-12 23:00
KMP
bzoj
读jQuery源码之五(ready事件,access)
源码3373-
3461
:主要包含ready事件//ThedeferredusedonDOMready varreadyList; jQuery.fn.ready=function(fn){ /
Rt-张雪飞
·
2015-12-10 17:00
poj-
3461
Oulipo 【kmp】
OulipoTimeLimit: 1000MS MemoryLimit: 65536KTotalSubmissions: 26367 Accepted: 10522DescriptionTheFrenchauthorGeorgesPerec(1936–1982)oncewroteabook,Ladisparition,withouttheletter 'e'.HewasamemberoftheOu
u014427196
·
2015-12-10 13:00
poj
3461
Oulipo KMP算法
id=
3461
题意:给两个字符串S,T;求S中最多含有多少个T。 很显然直接贴个KMP算法就可以解决了。
·
2015-11-13 16:29
poj
poj
3461
Oulipo (KMP模板题~) 前面哪些也是模板题 O.O
# include <stdio.h> # include <algorithm> # include <string.h> using namespace std; char a1[1000010],a2[1000010]; int next[1000010]; int len1,len2,cot; void Getnext() { int i=0,j
·
2015-11-13 11:26
poj
hdu
3461
Code Lock
pid=
3461
并差集和幂取模 这道题主要是求不可操作区间。
·
2015-11-13 05:31
code
poj-
3461
KMP 小结
这两天简单研究了KMP ,网上有很多讲解的文章,我在这里就不班门弄斧啦。大家要是学的话,可以看看这个人写的http://www.matrix67.com/blog/archives/115 。KMP要是只看讲解,估计会很困难,大家可以结合具体例子去调试分析学习,比较快把。NEXT 有很多不同的版本,我喜欢传统的版本,下面就用POJ这个题做个模板把。3561这个题目说的长。一看
·
2015-11-13 05:09
poj
poj
3461
Oulipo KMP算法
#include <iostream>#include <cstdio>#include <cstring>using namespace std;#define X 1000005char s[X],p[X];int Next[X],len1,len2;void shift() //计算移动的模板{int i,j = -1;Next[0] = -1;for(i
·
2015-11-13 03:25
poj
POJ
3461
#include<stdio.h> #include<stdlib.h> #include<string.h> #define N 1000005 int next[N],len1,len2,ans; char s1[N],s2[N]; void getnext(){ int k,j; len1=strlen(s1); next[0]
·
2015-11-13 00:08
poj
POJ
3461
Oulipo
id=
3461
题目大意 以A为子串,查找B中有几个A。 思路。
·
2015-11-13 00:35
poj
POJ
3461
Oulipo KMP算法
这个算法去年的这个时候就已经听过了,看毛片算法哈哈..不过理解它确实花了我很久的时间..以致于我一直很排斥字符串的学习,因为总觉得太难了,但是有些硬骨头还是要啃的,这个寒假就啃啃字符串还有一些别的东西吧,KMP的学习我看了好多好多博客才有那么些头绪,复杂度的分析更是无从谈起,不过线性匹配这样的算法实在太流弊了.~题目是水题,但也算是我的第一道KMP吧.~ #include<iostrea
·
2015-11-12 22:40
poj
POJ
3461
Oulipo
字符串模式匹配,KMP算法相当高效,O(n + m)。关键在求出模式串的next数组, 求完这个,一些基本的题应该都是没有问题了的,文本串只要扫描一次。求模式串在文 本中出现的次数,当匹配模式串的最后一个字符时,就说明出现了一次。 /*Accepted 1192K 94MS C++ 987B 2012-08-01 09:21:25*/
·
2015-11-12 22:03
poj
HDU
3461
Code Lock
题解:计算出所有可以操作的区间,留下不可操作区间求26的幂次即可,注意直接合并区间端点可能会出现一些问题,所以将右端点加一: #include <cstdio> #include <iostream> using namespace std; const int mod=1000000007; long long t; int f[10000010
·
2015-11-12 16:32
code
【POJ
3461
】【KMP】Oulipo
Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book: Tout avait Pai
·
2015-11-11 19:12
poj
POJ
3461
–Oulipo(KMP)
题目大意 给定一个文本串和模式串,求模式串在文本串中出现的次数 题解 正宗KMP 代码: #include<iostream> #include<cstring> #include<string> #include<cstdio> using namespace std; #define MAXN 10005 char T[MAXN
·
2015-11-11 17:42
poj
KMP算法详解
id=
3461
View Code 1 #include<stdio.h> 2 #include<string.h&
·
2015-11-11 16:54
KMP
POJ
3461
Oulipo(KMP)
题目链接 第一个KMP,纪念纪念。。。虽然比着模版打的,理解模版,真的好短。 1 #include <stdio.h> 2 #include <string.h> 3 char str1[10001],str2[1000001]; 4 int next[10001]; 5 int main() 6 { 7 int t,len1,len
·
2015-11-11 10:40
poj
字符串模式匹配:POJ
3461
Oulipo
这道题是字符串的模式匹配,要求计算出模式串在文本串中出现的次数,比如:"AZA" 在 "AZAZAZA" 中出现了 3 次; 这道题使用 KMP 过的,但是 horspool 却不能过,尝试了一下各种方法后,还是回到了麻烦的 KMP,留下了以下几个模版: 1. shift-or,据说比 KMP 快两倍,但只适用于模式串在 32 位以内,64位以内的也可以
·
2015-11-11 07:25
字符串
[POJ]
3461
Oulipo [KMP算法]
Oulipo Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 23667 Accepted: 9492 Description The French author Georges Perec (1936–1982) once
·
2015-11-11 05:11
poj
POJ
3461
Oulipo(模式串在主串中出现的次数)
id=
3461
题意:给你两个字符串word和text,求出word在text中出现的次数 思路:kmp算法的简单应用,遍历一遍text字符串即可,当前匹配的字符数达到word字符串的长度,即可确定
·
2015-11-08 16:33
poj
POJ
3461
Oulipo
之前比赛的时候,一道KMP的题目没有做出来,很是郁闷。最近一两天仔细研究了一下KMP,收获不少。基本的KMP思想算法什么的就不再赘述了。只是我在网上找资料的时候发现KMP的失配数组(next[])有两个版本,但是几乎没有资料将这两个版本的next[]做一个较好的分析。于是,写了这篇blog,对这两类next[]做了一个简单的分析,希望对大家有帮助,也希望大家能指出其中的错误和不足。由于直接贴文本格
·
2015-11-05 08:29
poj
pku
3461
kmp(模板)
对于这两次的比赛感到很无语, 不知道是不是很久没比赛了,以至于忘了比赛时的那个节奏,哎。。。 很早做出来一道题,然后一直都在研究一道题, 中间很想再换一道,但是想着 等把这个搞出来了再看下面的吧。。。。 以至于到最后还是没有搞出来,其他题也没有看,。 哎,找不到感觉了, 决定这两天不再学习新的算法, 把以前学过的算法看一下,先把这几场比赛给应付过去。。。 今天被这个kmp给难住
·
2015-11-03 22:31
KMP
kmp裸模版 poj
3461
#include #include usingnamespacestd; constintmaxn=1000000+10; chars[maxn],t[maxn]; intnext[maxn]; intm,n,k,l,i,T; voidget_next(charstr[]) { memset(next,0,sizeof(next)); next[1]=0; intlen=st
weiqingliu
·
2015-11-03 19:00
C++
ACM
POJ
3461
Oulipo ——KMP算法——Pku
3461
建议大家学一学比较巧妙的KMP算法吧,很有意思。推荐个题目:POJ3167 Cow Patterns 题解我会发在本博里。 这个KMP就木有什么好说的了吧,大家找百度百科学一下就可以了~ CODE Program KMP;//By_Thispoet Const maxn=1000005; Var st,s :Ansistring;//st is long and s
·
2015-11-02 17:21
poj
KMP算法 AC自动机 初见
KMP算法 poj
3461
Oulipo 题目大意:模板题。 思路:模板题。
·
2015-11-02 15:02
AC自动机
poj
3461
KMP模式匹配算法
View Code 1 /* 2 * Author:lonelycatcher 3 * problem:poj
3461
4 * Type:字符串匹配算法 Rabin-Karp算法 ,KMP
·
2015-11-02 13:13
poj
[PKU
3461
] 字符串(一) {KMP算法}
{ 下来准备写点关于字符串的东西 自然首先要写KMP 无奈自己对KMP理解不够 完全是因为看了 Matrix67神犇 的文章才理解的 班门弄斧就免了 无耻地先直接转载 } ====================Matrix67 原文==================== 如果机房马上要关门了,或者你急着要和MM约会,请直接跳到第六个自然段。 &nb
·
2015-11-02 11:20
字符串
poj
3461
Oulipo (KMP)
id=
3461
基础KMP, 要注意一次查找完成后,到下一可查找处继续匹配,这样才能保证得到最终个数。
·
2015-11-01 16:40
poj
数组实现队列
tid=
3461
粘一个看得懂,感觉比较实用的(其实别的都看不懂...)
·
2015-11-01 15:55
数组
HUD
3461
codelock 纯题意解释,不含思想
pid=
3461
纯题意解释,没有思想, 样例深度解释 第一行 N, M, 接下来有M行,N代表有几个字母组成, M代表有多少个可操作区间 对样例1的解释: 1 1 1 1 表示只有一个字母
·
2015-10-31 19:22
code
POJ
3461
Oulipo
POJ_
3461
今天开始学KMP啦,从gestapolur那里听说到Matrix67写的KMP通俗易懂,于是便去那里学了。
·
2015-10-31 14:22
poj
BZOJ
3461
: Jry的时间表
fl[i]表示[1,i]操作一次,且在[j+1,i]处操作的最大值 1:把[j+1,i]改为b[i]: max(sum[j]+b[i]*(i-j)) =b[i]*i+max(-j*b[i]+sum[j])(0<=j<i) 由于j递增,-j递减,所以从右往左建立凸壳,查询时在凸壳上二分查找即可,时间复杂度$O(n\log n)$。 2:把[j+1,i]改为b[j]
·
2015-10-31 10:17
ZOJ
POJ-
3461
Oulipo KMP
id=
3461
典型的KMP模板题,直接匹配个数即可。
·
2015-10-31 10:57
poj
poj
3461
kmp
求模式串在原串出现次数。 #include <cstdio> #include <cstring> #include <algorithm> #include <climits> #include <string> #include <iostream> #include <map>
·
2015-10-31 10:39
poj
POJ
3461
Oulipo(KMP统计子串出现次数)
Oulipo Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 12818 Accepted: 5128 Description The French author Georges Perec (1936–1982) once wrote a book, La dis
·
2015-10-31 10:26
poj
剪花布条
hdoj2087 题目大意: 解决:kmp,与poj
3461
神似,只需做小小的改动即可 #include <iostream> #include <cstring>
·
2015-10-31 10:30
Oulipo
poj
3461
题目大意:啥都不说了,就是一个模式匹配 解决:KMP 刚开始一直wa,后来经同学提醒突然想到了溢出了,改了之后,一次就过了 #include <iostream>
·
2015-10-31 10:29
IP
KMP算法/POJ
3461
(求匹配字符子串的个数)
1.Next数组 next[j]={ j=1时,0 j!=1时,最大子串长度+1,即P1P2….Pk-1==Pj-k+1….Pj-1,1<k<j,(看来j=2时是没有最大子串的,因此next[2]一定为1) 其它情况,1 } next[j]=0说明模式串与匹配串都要后移一位 next[j]!=0说明匹配串的当前字符与next[j]匹配 next数组的下标从1开始,因此我
·
2015-10-31 09:26
poj
hdu
3461
Code Lock
1 #include<iostream> 2 #include<cstdio> 3 #include<cstdlib> 4 #include<cstring> 5 #include<string> 6 #include<queue> 7 #include<algorithm> 8 #i
·
2015-10-31 09:19
code
poj
3461
Oulipo
OulipoTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:30629 Accepted:12305DescriptionTheFrenchauthorGeorgesPerec(1936–1982)oncewroteabook,Ladisparition,withouttheletter'e'.HewasamemberoftheOulipog
acm_fighting
·
2015-10-30 20:00
【Arduino】8地点LED数码管(
3461
BS)
淘宝买了一块
3461
BS的8地点LED数码管,婴儿就迫不及待地尝试,结果看到了文件,好家伙无Arduino测试程序。 莫急~莫急~无论如何串行操作,大不了呗瞎蒙!
·
2015-10-30 15:41
arduino
poj
3461
Oulipo kmp
Oulipo Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 26252 Accepted: 10478 Description The French author Georges Perec (1936–1982) once wrote a book, La di
·
2015-10-30 13:59
poj
Oulipo__poj
3461
__kmp
1 #include<cstdio> 2 #include<cstring> 3 const int maxm=1e4+5; 4 const int maxn=1e6+5; 5 char p[maxm]; 6 char t[maxn]; 7 int f[maxm]; 8 int ans; 9 void getfail() 10 { 11
·
2015-10-30 11:37
poj
BNUOJ 3580 Oulipo
Original ID:
3461
64-bit integer IO format: %lld &nb
·
2015-10-28 08:48
IP
POJ
3461
还是两种方法
上午我用了Rabin-Karp算法做的。基本的数据可以测试通过,但是一提交就WA。偶滴天啊,我不知道错在哪啊。。我是非专业的。。呜呜。找了半天找不出。算了。看人家都是用KMP做的,那我下午就用KMP写一个吧。一定把它拿下!!哼哼 Rabin-Karp: #include <iostream>#include <
·
2015-10-28 08:58
poj
KMP -- POJ
3461
KMP -- POJ
3461
解题报告 问题描述:给出字符串P和字符串T,问字符串P在字符串T中出现的次数 Sample Input 3 BAPC BAPC AZA
·
2015-10-27 16:34
poj
上一页
1
2
3
4
5
6
7
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他