TLE and when changing only the ordering of states got AC

Правка en1, от GiantTornado, 2020-02-05 14:31:59

Hello guys, I've recently solved this problem 628D - Magic Numbers by defining a dp array dp[b.length][m][2][2] and got TLE,

i used the exact same code with a different ordering of states dp[2][2][b.length][m] and got accepted.

These are my submissions you can compare them to check that nothing is different except the ordering of states in dp array : 70233950 70235256

why this happened?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский GiantTornado 2020-02-05 14:31:59 487 Initial revision (published)