|
|
вернуться в форумПоказать все сообщения Спрятать все сообщенияI know dp algorithm, but it is too slow - O(N^4). Please explain faster algorithm. Here algorithm O(1): use precalculated array ;) It is possible to use a different DP state and calculate each of N^2 cells in O(N) time (N^3 DP algorithm) |
|
|