// Problem: No.2626 Similar But Different Name // Contest: yukicoder // URL: https://yukicoder.me/problems/no/2626 // Memory Limit: 512 MB // Time Limit: 3000 ms #include #define debug(x) cerr<<(#x)<<" "<<(x)< #define rep(i,a,b) for(ll i=(a);i<=(b);++i) #define per(i,a,b) for(ll i=(a);i>=(b);--i) using namespace std; bool Mbe; ll read(){ ll x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } void write(ll x){ if(x<0)putchar('-'),x=-x; if(x>9)write(x/10); putchar(x%10+'0'); } const ll N=4e6+9; const ull B=131; ll n,m,k,ans[N],r[N],f[N],g[N]; char s[N],t[N]; ull hs[N],ht[N],pw[N],hs2[N]; struct Comp{ ld x,y; Comp(ld a=0,ld b=0){x=a,y=b;} }; inline Comp operator+(const Comp&a,const Comp&b){return Comp(a.x+b.x,a.y+b.y);} inline Comp operator-(const Comp&a,const Comp&b){return Comp(a.x-b.x,a.y-b.y);} inline Comp operator*(const Comp&a,const Comp&b){return Comp(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);} Comp a[N],b[N]; const ld PI=acos(-1.0); void FFT(Comp*a,ll p,ll sgn){ rep(i,0,p-1){ if(i>1; for(ll j=0;j>1]>>1)|((i&1)?(p>>1):0); rep(i,0,n-1)a[i].x=f[i],a[i].y=0; rep(i,n,p-1)a[i].x=0,a[i].y=0; rep(i,0,m-1)b[i].x=g[i],b[i].y=0; rep(i,m,p-1)b[i].x=0,b[i].y=0; FFT(a,p,1); FFT(b,p,1); rep(i,0,p-1)a[i]=a[i]*b[i]; FFT(a,p,-1); rep(i,0,n+m-1)f[i]=(ll)(a[i].x/p+0.5); } ull Hs(ll l,ll r){ return hs[r]-hs[l-1]*pw[r-l+1]; } ull Hs2(ll l,ll r){ return hs2[r]-hs2[l-1]*pw[r-l+1]; } mapmp; bool Med; int main(){ cerr<=m)res++; } write(res); return 0; }