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
# | User | Rating |
---|---|---|
1 | tourist | 3750 |
2 | Benq | 3726 |
3 | cnnfls_csy | 3690 |
4 | Radewoosh | 3649 |
5 | jiangly | 3631 |
6 | orzdevinwang | 3558 |
7 | -0.5 | 3545 |
8 | inaFSTream | 3477 |
9 | fantasy | 3468 |
10 | Rebelz | 3415 |
# | User | Contrib. |
---|---|---|
1 | adamant | 178 |
2 | awoo | 167 |
3 | BledDest | 165 |
4 | Um_nik | 164 |
5 | maroonrk | 163 |
6 | SecondThread | 158 |
7 | nor | 156 |
8 | -is-this-fft- | 154 |
9 | kostka | 146 |
10 | TheScrasse | 143 |
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
Name |
---|
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