Chef and Substrings
Read problems statements in Russian here Problem Statement Chef has a string S = S1S2 ... SN, consisting of N lowercase Latin letters. Also he has M pairs of integers Li, Ri (1 ≤ Li ≤ Ri ≤ N).For each pair Li, Ri, Chef writes out all distinct substrings of string S, which are started from positions Li, Li + 1, ..., Ri. Your task is to help Chef. That is, for each pair, find out how many substrin
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start