Because you are here:
for (size_t i = 0; i < N; i++)
suffixes[i] = s.substr(i);
: Create Nsubstrings of lengths 0, 1, 2, ..., N The total amount of memory that they will consume is: 1 + 2 + 3 + ... + Nbytes. Having the good old Gauss at hand, you will find that the sum of the first numbers N:N * (N + 1) / 2
, N = 100 000, 5 - , . 2 , , 64- .
: , , , :
: SuffixArray, , - lcp, suffixes. , ?