|
|
вернуться в форумPlease, help me to solve this problem.Give me a hint. Re: Use DP Please, give me any hint. Re: Use DP Послано PSV 5 июл 2006 06:20 Take an array 1..max, 1..max of longint that i,j element includes sum of numbers in 1..i 1..j rectangle - that you can calculate easily by n*n (I hope) than in n^4 cmplesity take all variants of different rectangles and calc their sum in linear time. I think my English take success with your mind Can U describe me O(n^3) solution? I have AC with O(n^4). Thanks. (-) Послано Alexey 10 июл 2006 14:44 Re: Can U describe me O(n^3) solution? I have AC with O(n^4). Thanks. (-) You must easily find maximum sum in vector for O(n), only fixed two parameters of submatrix(e.g. top && bottom). |
|
|