#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 ...
for(int i = 0; i < RN; i++) ++C[A[R[i]]]; for(int i = -1, v = 0; i <= AN && v < RN; v += C[i++]) swap(v, C[i]); for(int i = 0; i < RN; i++) D[C[A[R[i]]]++] = R[i]; ...
The suffix array and its variants are text-indexing data structures that have become indispensable in the field of bioinformatics. With the uninitiated in mind, we provide an accessible exposition of ...