MedoN11's blog

By MedoN11, history, 9 years ago, In English

Link to problem : http://codeforces.net/problemset/problem/543/A

DP solution with 501*501*501 memory (MLE but gives correct results when tested on PC) : http://ideone.com/edQhJr

DP solution with 2*501*501 memory ( dimension compressed) : gives WA on sample? : http://ideone.com/YNbwRO

Anyone has an idea why? Thanks.

  • Vote: I like it
  • 0
  • Vote: I do not like it