Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

The LCS Range Queries Question. Need Help!

Revision en4, by viralm, 2018-05-11 15:20:25
I am trying to solve a problem where I am given 2 strings A and B. Length of A is n and length of B is m. Now, q queries need to be answered. Each query will consist of 2 integers i and j such that 1 <= i,j <= n. For each such query, I want to find the length of the longest common sub-sequence of A.sub_string(i, j) and B.
Constraints:
1 <= n <= 10^4
1 <= m <= 10^4
1 <= Q <= 10^2

Time Limit: 3 seconds
Tags #dp, #strings, #data structure

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English viralm 2018-05-11 15:20:25 2 Tiny change: '= Q <= 10^3\n\nTime L' -> '= Q <= 10^2\n\nTime L'
en3 English viralm 2018-05-11 15:19:41 6 Tiny change: 'such that 0 <= i,j <= n - 1. For each' -> 'such that 1 <= i,j <= n. For each'
en2 English viralm 2018-05-11 15:16:15 5 Tiny change: ' find the length of' -> ' find the length of'
en1 English viralm 2018-05-11 15:14:15 506 Initial revision (published)