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

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

Hello,

I was solving CSES problemset and am stuck in this question — Question My code — Code

I am getting TLE on 4 test cases. I'm not able to figure out why as I have used standard BFS and therefore the time complexity should be O(m*n). Can someone help me in this?

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

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

Its because of maps. You can use 2D array instead.