|
|
вернуться в форумBFS or DFS When I used BFS,I found it would exceed the time limit. Does DFS also will exceed the time limit? Re: BFS or DFS Of course! Use DP... Re: BFS or DFS BFS got AC. I had AC, when use BFS, I dont know, why you got TL... Maybe your progrm is incrorrect, because BFS really got AC! Re: BFS or DFS If BFS got AC, tests for this problem is extremely weak... Re: BFS or DFS you are wrong: we can construct graph with n = 100 verticles and BFS solve it in O(n^2) Re: BFS or DFS So as DFS)) Re: BFS or DFS no, DFS is bad for this problem: we must compute the shortest sequence of words so DFS can work as slow as backtracking, exponential time Re: BFS or DFS Maybe you're right but I ment DFS with some changes) Re: BFS or DFS I also do DFS and got Time Limit on test 6 |
|
|