Task about finding a substring in a string using a suffix array

Правка en1, от MissTolochin, 2020-02-26 20:22:04

Today I tried to solve this problem (https://codeforces.net/gym/102069/problem/J).

It seems to be obvious that in this case, you can use a suffix array, and then use the bin.search for all the desired sub-sections (and during o(the length of the string to be found), check whether this sub-section is suitable), then use the segment tree to calculate the answer. However, this takes place in the first two subgroups (takes 25 points). There is one problem, it is that there is no guarantee that the sum of all the substrings that we have to check will not exceed any constant (for example, the length of the string). This means that you need to optimize the binary search (that is, find the desired sub-sections for a constant less than o(the length of the string to be found)). What data structure can be used to do this?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский MissTolochin 2020-02-27 11:26:06 297
ru3 Русский MissTolochin 2020-02-27 11:25:18 333
en2 Английский MissTolochin 2020-02-26 20:27:02 205
ru2 Русский MissTolochin 2020-02-26 20:26:00 170
en1 Английский MissTolochin 2020-02-26 20:22:04 890 Initial revision for English translation
ru1 Русский MissTolochin 2020-02-26 20:21:02 897 Первая редакция (опубликовано)