Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Solving grid questions.

Правка en1, от ay2306, 2018-07-18 16:59:28

I am working on a question like, there is given a m × n grid. Each cell holds value. What is the total number of paths from (a, b) to (c, d) given the sum of the values of cell in the path is m.

Possible movements from (i, j) are (i, j)→(i + 1, j), (i, j)→(i−1, j), (i, j)→(i, j + 1), (i, j)→(i, j−1)

I know it can be solved with dynamic programming but I was too much confused to what should I store. Because as contrasting to maximum cost path, it was not a stable value. What should I do in such case?

Теги #dynamic-programming, grid

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ay2306 2018-07-18 16:59:28 540 Initial revision (published)