ekdoteen123's blog

By ekdoteen123, history, 5 years ago, In English

https://codeforces.com/contest/431/problem/C

The recursive solution works but gives TLE for some inputs.

But when I memoize the solution it doesn't give the same results.

Here is my code: https://pastebin.com/EAX7T9RK

Thanks

Full text and comments »

Tags #dp
  • Vote: I like it
  • +1
  • Vote: I do not like it