mkmeden's blog

By mkmeden, history, 3 years ago, In English

https://codeforces.net/problemset/submission/377/143943114

Can anyone help me why i am getting TLE in this code at the 10th TC.

  • Vote: I like it
  • +6
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Your BFS goes to one cell many times. You should mark a cell as used when you add it to queue.