为什么这道题会WA描述You are given a sequence of integers,A = a1,a2,...an.A consecutive subsequence of A (say ai,ai+1 ...aj) is called a "repeated sequence" if it appears more than once in A (there exists some positive k that ai+k = ai,ai+k+1
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 07:39:20
为什么这道题会WA描述You are given a sequence of integers,A = a1,a2,...an.A consecutive subsequence of A (say ai,ai+1 ...aj) is called a "repeated sequence" if it appears more than once in A (there exists some positive k that ai+k = ai,ai+k+1
为什么这道题会WA
描述
You are given a sequence of integers,A = a1,a2,...an.A consecutive subsequence of A (say ai,ai+1 ...aj) is called a "repeated sequence" if it appears more than once in A (there exists some positive k that ai+k = ai,ai+k+1 = ai+1,...aj+k = aj) and its appearances are not intersected (i + k > j).
Can you find the longest repeated sequence in
输入
Line 1:n (1
为什么这道题会WA描述You are given a sequence of integers,A = a1,a2,...an.A consecutive subsequence of A (say ai,ai+1 ...aj) is called a "repeated sequence" if it appears more than once in A (there exists some positive k that ai+k = ai,ai+k+1
兄弟,你做的微软编程一小时那个题目吧?
你就差一点点,看到错误估计你要后悔了……
kmp函数第四行改成
for(int j=1;j