Acedbysomeone's blog

By Acedbysomeone, history, 6 years ago, In English

I don't understand why in some dp problems dp[0] is equal to 0,like the coin change problem.Can someone explain this to me?

Tags dp
  • Vote: I like it
  • -18
  • Vote: I do not like it

| Write comment?
»
6 years ago, # |
  Vote: I like it +6 Vote: I do not like it

It depends on what your table actually represents.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Why is not picking anything is also counted as a way?

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      the empty subset almost always counts as satisfying the condition to most problems.

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

afaik, in the coin change problem dp[0] = 1, so what do you mean?