ahmadexe's blog

By ahmadexe, history, 22 months ago, In English

So I am a newbie in DFS and BFS, and was solving this problem. Surprisingly, giving TLE in 3rd testcase. I can't seem to understand where code is inefficient since time complexity is looking fine to me.

I have added some comments, which don't use the ideal terminologies but would hopefully convey what I'm trying to do

https://mirror.codeforces.com/contest/1948/submission/267884593

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?