Timeout while using DFS

Правка en1, от sorablaze_11, 2017-12-20 18:33:47

I am solving this problem. And here is the solution. I am using only a simple dfs but it is showing timeout. I am not able to understand why, as time complexity of dfs is O(V + E) and my solution is well within the limits. Can someone help me? Please.

Теги dfs, timeout, cf358 div2c

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский sorablaze_11 2017-12-20 18:33:47 378 Initial revision (published)