ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1586. Threeprime Numbers

Doubt about my AC.
Posted by ajay jadhav 5 May 2020 00:31
I have two loops which calls recursive function

for 1 to 9
  for 0 to 9
    ans+=f(n-2,j,i) // f(rem,prev,prev_prev)

function f(i,j,k) has dp[1001][10][10] memoized solution.why doesnt it timeout.
I'm having hard time understanding my own solution although it is ACd in one trial.