-VIBE's blog

By -VIBE, history, 19 months ago, In English

The problem is not monster itself but problem name is....Can anyone tell me why i am getting tle...i am not able to figure out the time complexity of my solution.207893184

  • Vote: I like it
  • +6
  • Vote: I do not like it

»
19 months ago, # |
Rev. 4   Vote: I like it +1 Vote: I do not like it

Edit : I generate this test case in which your dfs will run in $$$O(n*m)$$$, the issue is your dfs update the value of each node too many time

1
2001 2000
2 1 0 2 1 0 ....
1 2
2 3
...
(simple path)