C. Sereja and Brackets

Revision en1, by wish_me, 2018-01-21 18:58:12

I was trying to solve the problem http://codeforces.net/problemset/problem/380/C .I saw Segment tree approach in the editorials.Now I was thinking Can we do it by memoization.Increasing the value +1 for every "(".Now we have two options ,Whether we should include next character to close this subsequence on not.Initially it would be exponential but by doing memoization I think we can do this.Looking to hear from you guyz?????

Tags #dp

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English wish_me 2018-01-21 18:58:12 450 Initial revision (published)