CandidFlakes's blog

By CandidFlakes, history, 3 hours ago, In English

This is the problem. This is my WA attempt.

What I am tying to do is first count how many maximum can be formed by x and x+1 each. Then, check if it is possible to decrease some amount of x+1 and increase some amount of x so that the overall answer increases. Please help me find where I am doing wrong?

I will be thankful for any help!

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
3 hours ago, # |
Rev. 4   Vote: I like it 0 Vote: I do not like it

Here is a much simpler way :- https://mirror.codeforces.com/contest/1995/submission/272131540 Its pretty easy to understand too, but let me know if you dont get it :)

  • »
    »
    3 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks so much for reply!

    I was looking to improve my incorrect solution. I went through editorial and found that they did something similar but their code is inaccessible.