|
|
back to boardShow all messages Hide all messagesi 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 My decision not worse at all... At last! AC 0.001 and 394 KB 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 If you use sorting, it must be at least O(n*logn) I used sorting and then found the LIS in O(nlogn) time, 0.031 seconds |
|
|