Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

mahmoud_arafa's blog

By mahmoud_arafa, 10 years ago, In English

Hello,

I tried to solve this problem using memoization (top-down DP) but the complexity of my code is too damn high!

Here is my code.

Can anyone help me solve this problem using memoization?

Tags dp, math
  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?