0_0_39778705_20521\Main.java:1: 错误: 非法字符: '#'
#include <iostream>
^
0_0_39778705_20521\Main.java:1: 错误: 需要class, interface或enum
#include <iostream>
^
0_0_39778705_20521\Main.java:2: 错误: 非法字符: '#'
#include <stdio.h>
^
0_0_39778705_20521\Main.java:3: 错误: 非法字符: '#'
#include <string.h>
^
0_0_39778705_20521\Main.java:6: 错误: 需要class, interface或enum
using namespace std;
^
0_0_39778705_20521\Main.java:7: 错误: 需要class, interface或enum
int nexts[10000 + 10];
^
0_0_39778705_20521\Main.java:8: 错误: 需要class, interface或enum
int n, m;
^
0_0_39778705_20521\Main.java:9: 错误: 需要class, interface或enum
int a[maxn], b[10000 + 10];
^
0_0_39778705_20521\Main.java:11: 错误: 需要class, interface或enum
void getNext(int *p,int next[]) { //优化后的求next数组的方法
^
0_0_39778705_20521\Main.java:13: 错误: 需要class, interface或enum
next[0] = -1; //next 数组中的 最大长度值(前后缀的公共最大长度) 的第一个 赋值为 -1
^
0_0_39778705_20521\Main.java:14: 错误: 需要class, interface或enum
int k = -1,j = 0;
^
0_0_39778705_20521\Main.java:15: 错误: 需要class, interface或enum
while (j < len - 1) {
^
0_0_39778705_20521\Main.java:17: 错误: 需要class, interface或enum
k++; j++;
^
0_0_39778705_20521\Main.java:18: 错误: 需要class, interface或enum
if(p[j] != p[k])next[j] = k;
^
0_0_39778705_20521\Main.java:19: 错误: 需要class, interface或enum
else next[j] = next[k]; //因为不能出现p[j] = p[ next[j ]],所以当出现时需要继续递归,k = next[k] = next[next[k]]
^
0_0_39778705_20521\Main.java:20: 错误: 需要class, interface或enum
}
^
0_0_39778705_20521\Main.java:22: 错误: 需要class, interface或enum
}
^
0_0_39778705_20521\Main.java:27: 错误: 需要class, interface或enum
int pLen = m;
^
0_0_39778705_20521\Main.java:28: 错误: 需要class, interface或enum
int i = 0, j = 0;
^
0_0_39778705_20521\Main.java:29: 错误: 需要class, interface或enum
while (i < sLen && j < pLen) {
^
0_0_39778705_20521\Main.java:31: 错误: 需要class, interface或enum
else j = nexts[j];
^
0_0_39778705_20521\Main.java:32: 错误: 需要class, interface或enum
}
^
0_0_39778705_20521\Main.java:34: 错误: 需要class, interface或enum
else return -1;
^
0_0_39778705_20521\Main.java:36: 错误: 需要class, interface或enum
}
^
0_0_39778705_20521\Main.java:41: 错误: 需要class, interface或enum
scanf("%d", &T);
^
0_0_39778705_20521\Main.java:42: 错误: 需要class, interface或enum
while (T--) {
^
0_0_39778705_20521\Main.java:44: 错误: 需要class, interface或enum
for(int i = 0; i < n; i++)scanf("%d", &a[i]);
^
0_0_39778705_20521\Main.java:44: 错误: 需要class, interface或enum
for(int i = 0; i < n; i++)scanf("%d", &a[i]);
^
0_0_39778705_20521\Main.java:44: 错误: 需要class, interface或enum
for(int i = 0; i < n; i++)scanf("%d", &a[i]);
^
0_0_39778705_20521\Main.java:45: 错误: 需要class, interface或enum
for(int i = 0; i < m; i++)scanf("%d", &b[i]);
^
0_0_39778705_20521\Main.java:45: 错误: 需要class, interface或enum
for(int i = 0; i < m; i++)scanf("%d", &b[i]);
^
0_0_39778705_20521\Main.java:45: 错误: 需要class, interface或enum
for(int i = 0; i < m; i++)scanf("%d", &b[i]);
^
0_0_39778705_20521\Main.java:46: 错误: 需要class, interface或enum
getNext(b,nexts);
^
0_0_39778705_20521\Main.java:47: 错误: 需要class, interface或enum
int ans = KMPSerach(a, b);
^
0_0_39778705_20521\Main.java:48: 错误: 需要class, interface或enum
if (ans != -1)printf("%d\n", ans + 1);
^
0_0_39778705_20521\Main.java:49: 错误: 需要class, interface或enum
else printf("-1\n");
^
0_0_39778705_20521\Main.java:50: 错误: 需要class, interface或enum
}
^
0_0_39778705_20521\Main.java:52: 错误: 需要class, interface或enum
}
^
38 个错误
|