Stucked at 607A — Chain Reaction

Revision en1, by haleyk100198, 2016-06-29 13:49:08

Link to the problem: http://mirror.codeforces.com/problemset/problem/607/A

Latest submission: http://mirror.codeforces.com/contest/607/submission/18781430

Code with comments: http://ideone.com/qlKrkI

I am trying an approach which uses DP to find the maximum number of previously activated beacon at position i, and finding the first out of range beacon by using binary search.

It seems that I am over-counting the activatable beacon in test 11, any thoughts why it went wrong? :/

Thanks for any help in advance.

Tags dp, binary search

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English haleyk100198 2016-06-29 13:49:08 684 Initial revision (published)