UVA 1213 — Sum of Different Primes, Help !!

Revision en2, by approach, 2021-10-01 11:34:00

Problem Link so, I was able to come up with memoization approach, but unable to write iterative version.

The correct one happens to be

Correct implementation

But I failed to realise, why this one is wrong.

wrong one

could u help me out please, any kind of help on how to approach such iterative DP problems, will be appreciated.

Tags need help, uva, dp problem, iterative dp

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English approach 2021-10-01 11:34:00 7
en1 English approach 2021-10-01 11:22:35 1190 Initial revision (published)