Блог пользователя saurabh3240

Автор saurabh3240, история, 4 года назад, По-английски

Hi All, Today I try to solve the problem C of Round 633. Where I misread the problem part Select some distinct indices i1,i2,…,ik these indices can be in any order. I misread it as selecting a range of elements [i k] containing a_i, a_i+1......a_k possibly empty range. And tried to solve this version.

I was wondering whether this version of the problem can be solved if yes, Then how to approach it?

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится

I think you can binary search over $$$x$$$ and in your evaluation function just pick suffixes of $$$a$$$ to boost by the powers of $$$2$$$. This will work because you know where you must increase values, and there's no harm in increasing entire suffixes when trying to construct an answer.

  • »
    »
    4 года назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    @limabeans thanks for answer. But i still didn't get the part "you know where you must increase values". what strategy should be used in deciding which suffix need to updated first with low powers and then which one later with high powers.