WA when doing Dimension compression?

Правка en1, от MedoN11, 2015-07-11 02:25:10

Link to problem : http://codeforces.com/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.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский MedoN11 2015-07-11 02:25:10 366 Initial revision (published)