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

Автор ABalobanov, история, 20 месяцев назад, По-английски

Hi to everyone! I decided to create a blog with some problem which was invented by me several years ago and only simple version of it was used in municipal stage of all-russian school olympiad in Kaliningrad. I wanted to use it somewhere but now I understand that it is not possible anymore because very very similar problem with similar ideas was used in codeforces round 858(it was f1-f2). I should have used it earlier somewhere and it is my second time that I lost my problem(first was div2 C from some old round). Now I just post it here so feel free to solve it and post your solutions. Later I can write my solution. Warning: if you haven't participated in round 858 and want to do it virtually or just solve problems from there then I advice you not to read it because you may get spoilers.

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

»
20 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by ABalobanov (previous revision, new revision, compare).

»
20 месяцев назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

For me the first part (figuring out how to solve the problem with $$$k = 2$$$) was slightly more difficult rather than generalizing it for bigger $$$k$$$'s.

Here is the solution:

Solution for k = 2
Solution for k = 1..n
  • »
    »
    20 месяцев назад, # ^ |
      Проголосовать: нравится +10 Проголосовать: не нравится

    Congrats! My idea was the same. About complexity: I started to work on this problem and had testcases where $$$O(Nlog^2C)$$$ was too much. There is $$$N(log N+log C)$$$ solution

    • »
      »
      »
      20 месяцев назад, # ^ |
      Rev. 2   Проголосовать: нравится +5 Проголосовать: не нравится

      Hmm, probably one can

      Spoiler

      Nice problem, by the way!