Correctness and Explaination of This DP solution Needed

Revision en2, by iamdumb, 2015-08-04 16:37:17

Hello guys,Few days ago this question was asked in Codechef cookoff.I was able to understand greedy part of the editorial but could not convince myself with DP approach.

Things I did not understand, In the picking of Pairs,where are we checking the conditions in which pair's difference is strictly less than D.I could not see it anywhere.

So basically I want you to please explain it to me.The more detailed the more helpful(as I am dumb :P).Thank you have a nice day.

[](https://discuss.codechef.com/questions/72500/sumpair-editorial) Editorial Link

Tags dp, unable to understand, editorial

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English iamdumb 2015-08-04 16:54:49 79
en3 English iamdumb 2015-08-04 16:47:54 1 Tiny change: 'problems/SMPAIR) was' -> 'problems/SUMPAIR) was'
en2 English iamdumb 2015-08-04 16:37:17 7 Tiny change: 'questions/46072/smpair-edit' -> 'questions/72500/sumpair-edit'
en1 English iamdumb 2015-08-04 16:18:22 725 Initial revision (published)