ilove_sundarKanya's blog

By ilove_sundarKanya, history, 3 hours ago, In English

Question Link In this problem, I initially implemented a DP solution by defining the state and transition. However, it resulted in a "Memory Limit Exceeded" error. Surprisingly, when I simply interchanged the row and column while keeping the logic, states, and transitions the same, the solution was accepted.

Can someone explain why this happened?

You can see the Accepted Submission

Memory Limit Exceeded Submission

»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by ilove_sundarKanya (previous revision, new revision, compare).

»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by ilove_sundarKanya (previous revision, new revision, compare).

»
3 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by ilove_sundarKanya (previous revision, new revision, compare).