Why giving TLE?

Правка en1, от ahmadexe, 2024-06-28 19:40:12

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

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский ahmadexe 2024-06-28 19:40:41 5 Tiny change: 'fine to me\nI have a' -> 'fine to me.\n\n\nI have a'
en1 Английский ahmadexe 2024-06-28 19:40:12 394 Initial revision (published)