Stucked at 607A — Chain Reaction

Правка en1, от 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.

Теги dp, binary search

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский haleyk100198 2016-06-29 13:49:08 684 Initial revision (published)