标签:小结 tps return break read pos 讲解 struct 大写
#include"bits/stdc++.h"
using namespace std;
typedef long long LoveLive;
inline int read()
{
int out=0,fh=1;
char jp=getchar();
while ((jp>‘9‘||jp<‘0‘)&&jp!=‘-‘)
jp=getchar();
if (jp==‘-‘)
{
fh=-1;
jp=getchar();
}
while (jp>=‘0‘&&jp<=‘9‘)
{
out=out*10+jp-‘0‘;
jp=getchar();
}
return out*fh;
}
const int MAXN=5e5+10;
const int Siz=26;
struct AhoCorasick{
int idx;
int ch[MAXN][Siz];
int fail[MAXN];
int val[MAXN];
void init()
{
idx=0;
memset(val,0,sizeof val);
memset(ch,0,sizeof ch);
memset(fail,0,sizeof fail);
}
AhoCorasick()
{
init();
}
void ins(char s[],int n)
{
int u=0;
for(int i=0;i q;
for(int i=0;i
#include"bits/stdc++.h"
using namespace std;
typedef long long LoveLive;
inline int read()
{
int out=0,fh=1;
char jp=getchar();
while ((jp>‘9‘||jp<‘0‘)&&jp!=‘-‘)
jp=getchar();
if (jp==‘-‘)
{
fh=-1;
jp=getchar();
}
while (jp>=‘0‘&&jp<=‘9‘)
{
out=out*10+jp-‘0‘;
jp=getchar();
}
return out*fh;
}
const int MAXN=1e7+10;
const int Siz=4;
int n,m;
int len[MAXN];
struct AhoCorasick{
int idx;
inline int id(char x)
{
if(x==‘E‘)
return 0;
if(x==‘W‘)
return 1;
if(x==‘N‘)
return 2;
return 3;
}
int ch[MAXN][Siz];
int fail[MAXN];
int marked[MAXN];
int f[MAXN];
int val[MAXN];
AhoCorasick()
{
idx=0;
memset(fail,0,sizeof fail);
memset(ch,0,sizeof ch);
memset(marked,0,sizeof marked);
memset(val,0,sizeof val);
}
void ins(char s[],int v)
{
int u=0;
for(int i=0;i q;
for(int i=0;i
#include"bits/stdc++.h"
using namespace std;
typedef long long LoveLive;
inline int read()
{
int out=0,fh=1;
char jp=getchar();
while ((jp>‘9‘||jp<‘0‘)&&jp!=‘-‘)
jp=getchar();
if (jp==‘-‘)
{
fh=-1;
jp=getchar();
}
while (jp>=‘0‘&&jp<=‘9‘)
{
out=out*10+jp-‘0‘;
jp=getchar();
}
return out*fh;
}
const int MAXN=1e5+10;
const int Siz=26;
int len[MAXN];
struct AhoCorasick{
int idx;
int ch[MAXN][Siz];
int fail[MAXN];
int val[MAXN];
AhoCorasick()
{
idx=0;
memset(ch,0,sizeof ch);
memset(fail,0,sizeof fail);
memset(val,0,sizeof val);
}
void ins(char *s,int n,int v)
{
int u=0;
for(int i=0;i q;
for(int i=0;i
#include"bits/stdc++.h"
using namespace std;
typedef long long LoveLive;
inline int read()
{
int out=0,fh=1;
char jp=getchar();
while ((jp>‘9‘||jp<‘0‘)&&jp!=‘-‘)
jp=getchar();
if (jp==‘-‘)
{
fh=-1;
jp=getchar();
}
while (jp>=‘0‘&&jp<=‘9‘)
{
out=out*10+jp-‘0‘;
jp=getchar();
}
return out*fh;
}
const int MAXN=1e6+10;
const int Siz=26;
int n;
struct AhoCorasick{
int idx;
int ch[MAXN][Siz];
int fail[MAXN];
int pos[MAXN];
int val[MAXN];
int ecnt;
int head[MAXN],to[MAXN],nx[MAXN],siz[MAXN];
AhoCorasick()
{
idx=0;
ecnt=0;
memset(ch,0,sizeof ch);
memset(fail,0,sizeof fail);
memset(val,0,sizeof val);
memset(head,0,sizeof head);
}
void ins(char *s,int len,int v)
{
int u=0;
for(int i=0;i q;
for(int i=0;i
#include"bits/stdc++.h"
using namespace std;
typedef long long LoveLive;
inline int read()
{
int out=0,fh=1;
char jp=getchar();
while ((jp>‘9‘||jp<‘0‘)&&jp!=‘-‘)
jp=getchar();
if (jp==‘-‘)
{
fh=-1;
jp=getchar();
}
while (jp>=‘0‘&&jp<=‘9‘)
{
out=out*10+jp-‘0‘;
jp=getchar();
}
return out*fh;
}
const int MAXN=3e4+10;
const int Siz=2;
struct AhoCorasick{
int idx;
int ch[MAXN][Siz];
int fail[MAXN];
int val[MAXN];
AhoCorasick()
{
idx=0;
memset(ch,0,sizeof ch);
memset(val,0,sizeof val);
memset(fail,0,sizeof fail);
}
void ins(char *s,int len)
{
int u=0;
for(int i=0;i q;
for(int i=0;i
#include"bits/stdc++.h"
using namespace std;
typedef long long LoveLive;
inline int read()
{
int out=0,fh=1;
char jp=getchar();
while ((jp>‘9‘||jp<‘0‘)&&jp!=‘-‘)
jp=getchar();
if (jp==‘-‘)
{
fh=-1;
jp=getchar();
}
while (jp>=‘0‘&&jp<=‘9‘)
{
out=out*10+jp-‘0‘;
jp=getchar();
}
return out*fh;
}
const int P=1e4+7;
inline int add(int a,int b)
{
return (a+b) % P;
}
inline int mul(int a,int b)
{
return a * b % P;
}
int fpow(int a,int b)
{
int res=1;
while(b)
{
if(b&1)
res=mul(a,res);
a=mul(a,a);
b>>=1;
}
return res;
}
const int MAXN=7777;
const int Siz=26;
int n,m;
struct AhoCorasick{
int idx;
int ch[MAXN][Siz];
int fail[MAXN];
int val[MAXN];
int f[101][MAXN];
AhoCorasick()
{
idx=0;
memset(ch,0,sizeof ch);
memset(fail,0,sizeof fail);
memset(val,0,sizeof val);
memset(f,-1,sizeof f);
}
void ins(char *s,int len)
{
int u=0;
for(int i=0;i q;
for(int i=0;i
标签:小结 tps return break read pos 讲解 struct 大写
原文地址:https://www.cnblogs.com/jklover/p/10251543.html