|
|
вернуться в форумgot AC in 0.31 but i still did n^2 is there anyhting better? i used a df after i made an oriented graf(it's much easier to do than other solutions) if u did it better than O(N*N) please email me at dmarius1@yahoo.com Thanks Edited by author 15.04.2004 19:05 AC time 0.015, but O(N*N). AC time 0.218, but N^3 and 884 kb memory My decision not worse at all... Re: AC time 0.218, but N^3 and 884 kb memory At last! AC 0.001 and 394 KB ac 0.001s O(n) I use dp O(n).ac in 0.0001s first,sort; second dp: answer=max{f(1)..f(n)}; f(i) means the best sum from the i one Re: ac 0.001s O(n) If you use sorting, it must be at least O(n*logn) Re: got AC in 0.31 but i still did n^2 is there anyhting better? Послано A.06 8 апр 2013 16:38 I used sorting and then found the LIS in O(nlogn) time, 0.031 seconds |
|
|