How to solve Chef and Way using Dynamic Programming?

Revision en1, by dush1729, 2016-01-13 20:36:47

I am trying to solve this using dynamic programming with complexity of O ( N ^ 2 ) which will give TLE because N <= 10 ^ 5.

Problem Link

Tags dynamic programming, codechef, lunchtime

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English dush1729 2016-01-13 20:36:47 235 Initial revision (published)