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

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

Автор Brainless_Loco, история, 4 года назад, По-английски

I don't know why it's getting MLE. Can you please tell me the reason.

MLE submission

Problem Link: D. Solve The Maze

Thanks in advance.

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

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

Hint: the only place with dynamic memory allocation in your code is queue<pair<int, int>>, so check your BFS carefully to ensure that the new items are not pushed endlessly into the queue.