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

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

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

This is my attempt at the question:

http://codeforces.com/contest/793/submission/27930364

As I couldn't see the test case for which it is failing I was scrolling through other solutions and found 1 that is very similar, but that has passed. Any help with telling me why mine fails?

Similar solution that passes: http://codeforces.com/contest/793/submission/27902199

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

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

Here is a test case your code fail:

3 4
S...
...*
.*.T

basically, you are checking whether a grid is visited or not, but not the direction in which it is travelling. So you will need 1 more dimension for the direction. (something like v[i][j][dir] instead)