Divide and conquer optimization

Revision en2, by mak_0111, 2016-12-06 23:04:54

I have been trying to understand dp divide and conquer optimization but I am not able to solve spoj NKLEAVES (http://www.spoj.com/problems/NKLEAVES/). How to calculate cost function C[i][j] for a bunch of leaves in O(1) time using appropriate preprocessing?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English mak_0111 2016-12-06 23:04:54 0 (published)
en1 English mak_0111 2016-12-06 23:04:10 291 Initial revision (saved to drafts)