pls help anybody i am getting tle in O(10^6)

Revision en2, by jovial3, 2021-11-17 17:11:37

whenever i use dfs or bfs following my template I get tle for example

this question-

https://codeforces.com/contest/1600/problem/J

this is my submission-

https://codeforces.com/contest/1600/submission/135985780

Tags java

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English jovial3 2021-11-17 17:11:37 28 Tiny change: 'example \nthis que' -> 'example \n\n\n\n\n\n\n\n\nthis que'
en1 English jovial3 2021-11-17 17:10:21 257 Initial revision (published)