saurabh3240's blog

By saurabh3240, history, 5 years ago, In English

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?

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
5 years ago, # |
  Vote: I like it +12 Vote: I do not like it

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.

  • »
    »
    5 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    @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.