Mohsina_Shaikh's blog

By Mohsina_Shaikh, history, 20 hours ago, In English

Can someone please explain how the dp transition works in the above problem.

https://cses.fi/problemset/task/1080

I tried reading editorial from https://usaco.guide/problems/cses-1080-empty-string/solution

But not able to understand why we need to (k−i+1)/2 and (j−i+1)/2. For removing substrings from range [i,j] would not (j-i+1)/2 be enough,why are we also multiplying with (k-i+1)/2

Awaiting responses.

Thanks ​

  • Vote: I like it
  • 0
  • Vote: I do not like it