|
|
back to boardO(N^3) works! Posted by GaLL 18 Feb 2006 12:56 Certainly there exist O(N^2) algo, but I had fun solving this problem by O(N^3) in 0.546 sec. Re: O(N^3) works! Please, give me an email or icq num so we can communicate. I want to ask you a few questions. mail My e-mail is gallnrs@yandex.ru Re: O(N^3) works! That only means that there are tests with large ammounts of edges. Re: O(N^3) works! Running time of my algo doesn't depend on quantity of edges (except time of reading), only on N. It's like Floyd algorithm. Re: O(N^3) works! Posted by dimozzz 15 Feb 2007 21:42 My program solve it for O(n ^ 2). But the time more than 1.1 sec. Edited by author 15.02.2007 21:45 Re: O(N^3) works! Same thing here. O(N+M) works in 1.2 sec. Optimizing scanf to gets+strtok makes it 0.9 sec. |
|
|