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

Автор pkhaustov, 10 лет назад, По-русски

Всем доброго времени суток,

16 октября 2014 года в 19:30 MSK состоится очередной раунд Codeforces #273 для участников из второго дивизиона. Традиционно, участники из первого дивизиона могут участвовать в соревновании вне конкурса.

Автор задач: pkhaustov (Хаустов Павел, Россия, Томск, Томский ПУ)

За подготовку раунда отдельное спасибо коллективу Codeforces и, в частности, Максиму Ахмедову (Zlobober) за помощь в подготовке и Марии Беловой (Delinur) за перевод условий задач на английский язык.

Участникам будет предложено пять задач и два часа на их решение.

Распределение баллов по задачам: 500-1000-1500-2000-2500

UPD: Старт сдвинут на 10 минут

Желаю удачи всем участникам!

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

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

Zlobober has contribution +125. But why he isn't in top contributors?

»
10 лет назад, # |
  Проголосовать: нравится -160 Проголосовать: не нравится

Bad luck to everyone , because I want to be first at ranking. I gotta have the only good luck in participants.

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

It seems like it would be a lot of programming with no math

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится -24 Проголосовать: не нравится

    You meant a lot of math with no programming right? Because that's two different things.

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится -7 Проголосовать: не нравится

    Wow, apparently other people share my ideas as well :o

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится +43 Проголосовать: не нравится

    As it turns out, all problems are math (with some programming)...

    • »
      »
      »
      10 лет назад, # ^ |
        Проголосовать: нравится +3 Проголосовать: не нравится

      REVENGE!!!

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

      Also, I noticed that usually when competitive programmers say "mathematics", they mean "number theory" :P

      • »
        »
        »
        »
        10 лет назад, # ^ |
          Проголосовать: нравится +5 Проголосовать: не нравится

        Combinatorics (counting) is also common. I think D is combinatorics?

        Other fields of mathematics are hard to use in computer programming. I once made an algebra/geometry problem of sorts (given three points on plane, find a line that minimizes the sum of distances from the points to the line), but those kinds of problems are hard to find.

        • »
          »
          »
          »
          »
          10 лет назад, # ^ |
            Проголосовать: нравится +5 Проголосовать: не нравится

          Sure, dp/greedy are all combinatorics and so, are essentially mathematics. The point I was trying to make is that many people don't accept this and according to them, mathematics problems means problems involving numbers and equations. So, if some such guy says that some contest was full of math problems, it means that it was full of number theoretic or elementary algebra problems.

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

    you know you are in a math oriented contest when memory of your first 3 solutions is 0 Kb.

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится -8 Проголосовать: не нравится

    Most of programming doesn't involve math at all: look what typical job postings say.

»
10 лет назад, # |
  Проголосовать: нравится -21 Проголосовать: не нравится

Looked to become Blue Coder

:D

»
10 лет назад, # |
  Проголосовать: нравится -61 Проголосовать: не нравится

GOOD LUCK & HAVE FUN!!!

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

With the timing of this round, does it mean we won't have a gym training this week or it will be moved to another day?

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

Your last contest had nice problems.

Thank you for creating another contest.

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

Hello. This is my second contest on Codeforces and strangely, I don't get an option to register for this round. Any idea why it's so?

»
10 лет назад, # |
Rev. 2   Проголосовать: нравится -13 Проголосовать: не нравится

I'm registering the first :P

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

Thank you for earlier registration opening! ;)

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

How do I get contribution scores? Thanks.

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

    by not getting downvotes

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

    Strangely nobody has answered your question in details. To get contribution scores you can try to:

    • write editorials for the round which do not have any.

    • prepare a CF round or at least a gym contest. Announcement might bring a lot of contribution points, though it depends on the announcement.

    • post some funny jokes on CF. This seems to be the most effective way but you need to stay on-topic while posting the jokes.

    • maybe write some good programming related articles here? Didn't try this one though.

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

Please give the score distribution just 20 mins left.

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

Delayed

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

Delay :/

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

Those who cannot remember the past are condemned to repeat it. By Dynamic Programming How many up votes for Dynamic Programming??

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

I registered for the contest but still couldn't submit as if I wasn't registered. This has happened with my friend once too. Some bug. admin please fix! -_-

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

Problem C = a bunch of hacks.

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

Претесты по С очень слабые.

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

How to solve D?

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

    You find the maximum possible height (approximately ) and do dynamic programming: DP[h][r] = the number of possibilities to build the tower with height h and using r red blocks (and h * (h + 1) / 2 - r green blocks).

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

    R and G are 2e5 so number of levels are at most 600 ! It can be solved like Knapsack problem !

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

      could you explain what kind of knapsack?

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

        DP[i][j] :: How many ways exist that we choose some level between 1 to i and sum of levels widths be j ...

        DP[i][j] = DP[i-1][j] + DP[i-1][j — i];

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

          when i tried to store dp[i][j] i got memory limit error. it is possible to use only dp[j] vector. And h times recalculate values.

    • »
      »
      »
      10 лет назад, # ^ |
      Rev. 3   Проголосовать: нравится +1 Проголосовать: не нравится

      R+G <= 4e5

      number of levels < 900

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

        You are right, but it is not important ! 1e3 * 2e5 = 2e8 and is fast enough.

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

I have never seen so many hacks.

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится +5 Проголосовать: не нравится

    Because you have participated in so many contest, right?

    • »
      »
      »
      10 лет назад, # ^ |
        Проголосовать: нравится +3 Проголосовать: не нравится

      Haha, I have participated in some contest, but I forgot that handle! So I had to register a new one.

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

I made 12 successful hacks for problem c, but my own solution is wrong. Ridiculous.

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

Would someone please tell how to solve D !

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    try to formulate a top-down DP solution that takes O((r+g)*h), this will give you MLE, then try to formulate the same DP bottom-up, this will require only O(r) in space and runtime of O((r+g)*h), if you see my code you will see both approaches

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

how to solve problem D?

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

двух человек пытался взять на таймлимит по B, но оказывается 1 миллиард операций входит в 1 секунду :(

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

    абсолютно то же самое. очень обидно

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

      Поддерживаю, действительно неприятно

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится +14 Проголосовать: не нравится

    Скорее всего вы говорите о более-менее одном и том же необычном случае.

    В раунде была пара сабмитов, в которых фигурировали строки вида:

    int a = 0;
    for (int i = 0; i < b; i++)
      a += x;
    

    Где b имеет порядок 109. То, что такое решение работает, и время исполнения — 15 мс не значит, что сервера Codeforces научились выполнять десятки миллиардов операций в секунду. Это значит, что шибко умный компилятор оптимизирует данный цикл в что-то наподобие:

    int a = b * x;
    

    Так что шансов почелленджить подобное решение немного =)

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

C hack case?

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

I'm seeing people in top 10 (including unofficial participants) which had a wrong answer of test 3 of problem A!

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

how to solve C and D.

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

How to solve E? (Quite interesting problem)

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

Thank you pkhaustov for the round. I especially enjoying hacking the solutions of C! Apparently the pretests were rather weak.

Unfortunately, this seems to cause some agression among the contest participants who happen to get hacked... after hacking this guys solution, I got this "friendly" message, of which I can't even understand the half:

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

Why admin has block the page that we can see contest's history of each member?

»
10 лет назад, # |
Rev. 2   Проголосовать: нравится -6 Проголосовать: не нравится

Duplicate comment. Please ignore.

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

Hints for problem D:

Let h denote the maximal height made.

  • Main observation: h <= sqrt(rleft + bleft).
  • Trivial dp will be to maintain currrent h, rleft and gleft.
  • It can be optimizied to dp(h, rleft) because gleft is a redundant parameter.
  • Then optimize space by making observation that h is dependent on h — 1.
  • Complexity h * (r + g).
»
10 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Whoa ! what a speed of system testing !

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

Спасибо за моноширинный шрифт при взломах! А то раньше было больно читать некоторые исходники.

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится +21 Проголосовать: не нравится

    Всегда же был моноширинный.

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

      Сколько помню, под хромом у меня всегда был немоноширинный (windows, linux). Под фаерфоксом до обновления флеша тоже был немоноширинный. А у вас какой браузер/ОС?

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

Terrible!! What such a hack attempts :D

»
10 лет назад, # |
Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

This is the shortest solution for C problem that I ever wrote !!!

sol = min(sum / 3, t[0] + t[1])

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    Can you please explain the solution? I can't get it till now. Thanks

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

      Max number is sum / 3. I thought in the idea to form groups taking 2 items from the bigger one and taking only one item from the lower groups each time. Using this way if sum / 3 is bigger than the sum of the 2 lower values then it means that I can get only a + b (sum of the two lowest values) taking 2 from biggest value and 1 from any lower value. I am thinking in a mathematical proof but this was my approach.

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

    you are right

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится +8 Проголосовать: не нравится

    you forgot to sort t =)

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

    I solved it using the same solution .. do you have a proof of correctness?

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

      No, I don't have a proof. I saw that the max number is sum / 3 and then I thought in the idea to form groups taking 2 items from the bigger and taking only one item from the lower groups each time.

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

    Hi can you please explain it? Thanks :)

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится +24 Проголосовать: не нравится

    assume t[0] <= t[1] <= t[2]. and sum = t[0] + t[1] + t[2].

    best case would be sum / 3. because no matter what we do we will always be left with sum % 3 balloons. now when can we get sum / 3 tables and when we can not:

    case 1: if 2 * (t[0] + t[1]) <= t[2] than it is obvious that we can not get more then t[0] + t[1] tables because at each table at least 1 balloon is subtracted from t[0] + t[1], and by taking 2 from t[2] and 1 from t[0] + t[1] at each turn we can get exactly t[0] + t[1] tables.

    case 2: if 2 * (t[0] + t[1]) > t[2]. let's prove that we can get sum / 3 tables in such case. by tactic taking 2 from t[2] and one from max(t[0], t[1]), t[0] + t[1] will not become zero before t[2] becomes zero, which means that at some point t[2] will become at most max(t[0], t[1]). and at that point difference between t[2] and max(t[0], t[1]) will not be more than 2. no we know that max(t[0], t[1], t[2]) — second_max(t[0], t[1], t[2]) is not more then 2. we can use this as an invariant. tactic taking 2 from max and one from second_max does not change invariant. now suppose we have some choosing tactic, we are stuck when we have situation like this a 0 0 where a >= 0 or 1 1 0. if a <= 2 it means choosing was optimal because no matter what we do we will be left with sum % 3 ballons. and second finish(1, 1, 0) is also optimal by same reason. answer in both cases will be sum / 3. according to our invariant we will not be left with a 0 0 with a > 2 because if a > 2 then our invariant does not hold. so we now that our choosing was optimal and answer is sum / 3.

    now what min(sum / 3, t[0] + t[1]) does is exactly checking if 2 * (t[0] + t[1]) <= t[2]. because if t[2] >= 2 * (t[0] + t[1]) (case 1) then sum / 3 = (t[0] + t[1] + t[2]) / 3 >= (t[0] + t[1] + 2 * (t[0] + t[1])) / 3 = t[0] + t[1]. so min(sum / 3, t[0] + t[1]) will be t[0] + t[1] (exactly answer to case 1).

    if t[2] < 2 * (t[0] + t[1]) (case 2) then sum / 3 = (t[0] + t[1] + t[2]) / 3 <= (t[0] + t[1] + 2 * (t[0] + t[1])) / 3 = t[0] + t[1] so min(sum / 3, t[0] + t[1]) will be sum / 3 (exactly answer to case 2).

    hope it was helpful :D

    • »
      »
      »
      10 лет назад, # ^ |
        Проголосовать: нравится +1 Проголосовать: не нравится

      Do you think we can extend it to any for any number of colors? In the contest I came up with this formula for 2 numbers i.e. min((r+g)/3,r). You have proved it for 3 numbers. Can it be extended for 4,5,6,7...?

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

      Thanks sb-man , Was having a hard time finding explanations for old problems......:P

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

      This comment deserves a thousand up-votes.

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

TLE on test 11 in D cuz I used long long int. Changed it to int AC. -_-

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

Gotta appreciate the fast system tests & rating updates at the same time. Usually one of them only occurs that fast :D

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

in cf 273 div 2 , I have submitted problem A,B,C. but I got no verdict for problem B . in my submissions it is written "skipped" !! whats the problem ?? can anyone plz help me !! http://codeforces.com/submissions/kifayat

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

Heh, solved 3 problems and became blue!!! It have surprised me!

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

Question about E) How comes the number "11" to not be a wavy number? I cannot find the definition like two adjacent digits should be different..

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

    Read the problem statement. It says: "A wavy number is such positive integer that for any digit of its decimal representation except for the first one and the last one following condition holds: the digit is either strictly larger than both its adjacent digits or strictly less than both its adjacent digits." For the first and last digits the adjacent digit if exits should also be strictly larger or strictly less than the digit. "strictly larger" or "strictly less" does imply that two adjacent digits should be different. Hence the number "11" cannot be a wavy number.

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

      "for any digit of its decimal representation except for the first one and the last one..."

      So 11, ignoring the first and last digits, becomes an empty string; all of its digits are (vacuously) strictly more or less than the adjacent digits. Of course, this is definitely an oversight on their part.

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

        Completely agree, the statement is wrong, 11, 22, 33,..., 99 are wavy numbers.

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

        After loosing a lot of time, I had to assume that 11, 22, ...,99 are not wavy in order to get the problem accepted. What disappointing.

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

questions was very easy and interesting.

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

Can anybody tell me concepts in problem A and B

my solution : http://codeforces.com/contest/478/my

Constantly getting wrong answer.

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

How to solve C? Pleas with proof

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

    if you wont i will send my solution. my solution is to short. i think you will uderstand

  • »
    »
    10 лет назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    First of all take the maximum if it is >2*(sum of other two) then answer will be (sum of other two) because for every element taken of rest two take 2 elements of maximum. now suppose max<= 2*(sum of other two) then answer will be (sum of three)/3. you can observe this by take the balls greedily.

    • »
      »
      »
      10 лет назад, # ^ |
        Проголосовать: нравится +1 Проголосовать: не нравится

      This is your algorithm, but what is your proof?

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

        Easy to noticed there are only 2 case of arrangements, RRG and RGB. Use the second one when number of colors "balanced" enough, and the first one to the rest. Then consider if all arrangement is first scenario. So, you have (a[1] + a[2]) triples, and use 2 * (a[1] + a[2]) from the a[0]

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

thanks a lot to KhaustovPavel for contest.

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

Your last contest and this contest has nice problems.

Thanks a lot pkhaustov . you are a good designer(problem).

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

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

Can D be solved without dynamic programming? (like a combinatorial formula)

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

    it looks like can, but difficult to understand and to find a formula.

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

    It looks like it's related to the problem of integer partitions — the number of ways to make a tower using R red blocks is the number of ways to write R as a sum of unique positive integers. I got stuck writing a solution like this, but it seems doable.

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

      that's wrong, because you don't need to use all the blocks

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

        You're right — so the full solution would be to find how many different numbers of red blocks you can use to make a tower and sum these partitions for each number.

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

huy guys. could you tell me what I dont understand in task A (yeah I know its simple)?? I feel depressed because of it :(

JS: (fails on test 3)

var N = readline().trim().split(" ").map(function(x){return parseInt(x);}); var sum = 0; for(var i=0; i < N.length; i++){ sum+=N[i]; } if (sum%5 != 0) {print(-1);} else {print(sum / 5);}

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

When does the Editorial be showed?

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

Problem E seems very interesting, could anyone give a hint?

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

Can I get the explanation for problem C? I don't understand the logic behind it.

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

Where can i find editorials? I'm new to codeforces.

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

lol my B (http://codeforces.com/contest/478/submission/8257290) failed because js arithmetics check in js console: 499967831017438365 * 2 / 2

output: 499967831017438340

:)

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

we are waiting for editorials!

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

Oh! The solution is in Russian while my Russian is very poor. I'm looking forward the solution in English. And I hope that the author can offer us the solution in English.

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

It was a great contest!!

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

Where can i find editorial of this contest?

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

I don't know why haven't the editorial been added until now .

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

for Problem C , can someone explain this test: 100500 100500 3 Answer : 67001

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

why in the hell the editorial are not available

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

Sorry for the necro-post.
I posted an english explanation to problem D here. Since the original blog is in Russian, it does not show up in the English version of codeforces, hence my comment here.