Codeforces Round #422 (Div. 2), problem: (E) Liar Solution In C/C++

By |2017-07-25T09:04:16+00:00July 25th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

#include<bits/stdc++.h> typedef long long ll; const int N=100010; const ll mo=1000000007; int n,x,i,l,r,m,mid,g[N][35],j,k; ll hs[N],ht[N],q[N]; char s[N],t[N]; inline ll hashs(int l,int r){ return (hs[r]-hs[l-1]*q[r-l+1]%mo+mo)%mo; } inline ll hasht(int l,int r){ return (ht[r]-ht[l-1]*q[r-l+1]%mo+mo)%mo; } inline int lcp(int i,int j){ if(s[i]!=t[j])return 0; l=1; if(m-j<n-i)r=m-j+1; else r=n-i+1; [...]