mkmeden's blog

By mkmeden, history, 2 years ago, In English

https://codeforces.com/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

»
2 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.