后缀数组SA-IS模板

本文介绍了后缀数组SA-IS算法,强调其在解决字符串问题时的高效性,并推荐了若干篇相关优质博客和论文资源,帮助读者深入理解。
摘要由CSDN通过智能技术生成

.
SAIS真的好快啊,在UOJ能卡进第二页
推荐几个讲的比较好的博客
链接1
链接2
链接3
和一篇讲了各种后缀数组算法的论文
Code:

#pragma GCC optimize("O3")
#pragma G++ optimize("O3")
#include<stdio.h>
#include<string.h>
#include<algorithm>
#define N 100010
using namespace std;
const int BufferSize = 1180000;
char buffer[BufferSize];
char *out_tail = buffer;
inline void putint(int x)
{
   
	if (!x) *out_tail++ = '0';
	else
	{
   
		register char s_pool[6], *s_tail = s_pool;
		while (x != 0) *s_tail++ = x % 10 + '0', x /= 10;
		while (s_tail-- != s_pool) *out_tail++ = *s_tail;
	}
	*out_tail++ = ' ';
}
char S[N]; int n,m;
int s[N<<1],t[N<<1],H[N],sa[N],r[N],p[N],c[N],w[N];
inline int trans(int n,const char* S){
   
	int m=*max_element(S+1,S+1+n);
	for(int i
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值