Let $s$ be a string of length $n$. The $i$-th suffix of $s$ is the substring $s[i \ldots n - 1]$. A suffix array will contain integers that represent the starting ...
#define clr(v, d) memset(v, d, sizeof(v)) #define rep(i, v) for(int i=0;i<sz(v);++i) #define lp(i, n) for(int i=0;i<(int)(n);++i) #define lpi(i, j, n) for(int i=(j);i ...