mkmeden's blog

By mkmeden, history, 5 years ago, In English

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

»
5 years ago, hide # |
 
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.