题目链接:点我
题意:求出长度不小于k的公共子串个数
思路:本来想套个二分查询的,但是发现真的难搞,转移也不知道错哪了,用单调栈写,发现转移也不好写,于是基本都是借鉴的…
下面是代码
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#define Fi first
#define Se second
#define ll long long
#define inf 0x3f3f3f3f
#define lowbit(x) (x&-x)
#define in(b) scanf("%d",&b)
#define mmin(a,b,c) min(a,min(b,c))
#define mmax(a,b,c) max(a,max(b,c))
#define debug(a) cout<<#a<<"="<<a<<endl;
#define debug2(a,b) cout<<#a<<"="<<a<<" "<<#b<<"="<<b<<endl;
#define debug3(a,b,c) cout<<#a<<"="<<a<<" "<<#b<<"="<<b<<" "<<#c<<"="<<c<<endl;
#define show_time cout << "The run time is:" << (double)clock() /CLOCKS_PER_SEC<< "s" << endl;
using namespace std;
const int N=3e5+10;
char s[N];
int x[N],y[N],sa[N],height[N],rnk[N],c[N];
void get_c(int n,int m)
{
for(int i=0;i<=m;i++) c[i]=0;
for(int i=1;i<=n;i++) c[x[i]]++;
for(