Блог пользователя GiantTornado

Автор GiantTornado, история, 7 лет назад, По-английски

Hello guys, I've recently solved this problem 628D - Волшебные числа 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?

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

It's about cache optimization.

https://codeforces.me/blog/entry/69685