Codeforces и Polygon могут быть недоступны в период с 23 мая, 7:00 (МСК) по 23 мая, 11:00 (МСК) в связи с проведением технических работ. ×

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

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

Hello,

I was recently reading the solution for the 2016 CEOI problem Kangaroo. However, I can't understand what motivates you from switching from A[n][i][j] and D[n][i][j] to trying to compute X[n][i][j] and Y[n][i][j]. I know it's a common trick to substitute sum and difference, but is there a deeper reason for why I would think of doing this substitution and knowing that it will work out?

Problem: https://oj.uz/problem/view/CEOI16_kangaroo Solution: http://ceoi.inf.elte.hu/probarch/16/kangaroo-solution.pdf

-dx24816

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

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

It is usual to write any DP solution, look at the transition and try to simplify it/apply data structures.