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

Автор vovuh, история, 4 года назад, По-русски

<almost-copy-pasted-part>

Привет! В 12.12.2019 16:35 (Московское время) начнётся Codeforces Round 605 (Div. 3) — очередной Codeforces раунд для третьего дивизиона. В этом раунде будет 6 или 7 задач (или 8), которые подобраны по сложности так, чтобы составить интересное соревнование для участников с рейтингами до 1600. Однако все желающие, чей рейтинг 1600 и выше могут зарегистрироваться на раунд вне конкурса.

Раунд пройдет по правилам образовательных раундов. Таким образом, во время раунда задачи будут тестироваться на предварительных тестах, а после раунда будет 12-ти часовая фаза открытых взломов. Я постарался сделать приличные тесты — так же как и вы буду расстроен, если у многих попадают решения после окончания контеста.

Вам будет предложено 6 или 7 (или 8) задач и 2 часа на их решение.

Штраф за неверную попытку в этом раунде (и последующих Div. 3 раундах) будет равняться 10 минутам.

Напоминаем, что в таблицу официальных результатов попадут только достоверные участники третьего дивизиона. Как написано по ссылке — это вынужденная мера для борьбы с неспортивным поведением. Для квалификации в качестве достоверного участника третьего дивизиона надо:

  • принять участие не менее чем в двух рейтинговых раундах (и решить в каждом из них хотя бы одну задачу),
  • не иметь в рейтинге точку 1900 или выше.

Независимо от того являетесь вы достоверными участниками третьего дивизиона или нет, если ваш рейтинг менее 1600, то раунд для вас будет рейтинговым.

Спасибо MikeMirzayanov за платформы, помощь с идеями для задач и координацию моей работы. Спасибо моим очень хорошим друзьям Дарье nooinenoojno Степановой, Михаилу awoo Пикляеву, Максиму Neon Мещерякову и Ивану BledDest Андросову за помощь в подготовке и тестирование раунда.

Удачи!

Также хочу сказать, что участники, намеренно отправляющие неверные решения и взламывающие их после окончания соревнования (пример), не будут показаны в таблице лидеров по взломам.

</almost-copy-pasted-part>

UPD: Огромное спасибо Артему Rox Плоткину и Дмитрию _overrated_ Умнову за тестирование раунда и помощь с исправлениями ошибками! Артем также предложил одну из задач на сегодняшний раунд!

UPD: Разбор опубликован!

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

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

Hope to see non-black IDs win this contest(for whom this isn't first contest)

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

Непривычно видеть vovuh желтым :)

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

Anyways I hope high ratings to all the non-black handles

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

vovuh one love

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

Orange vovuh

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

I think it is the first round made by vovuh as a Master . Good Luck and I hope the contest will be nice .

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

Add the information to the right to capture the audience.e.

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

will 15 december held two contest?

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

After a long time Codeforces arranged a contest. I am waiting for this contest. I think, the contest will be nice and interesting for me and also for others. Thanks to MikeMirzayanov and vovuh for arranging the [Codeforces Round #605 (Div. 3)] contest.

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

hoping to qualify for Codeforces platinum!

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

79353118_444821413104507_8018561245638557696_n2.jpg

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

А где регистрация или ее нету?

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

Is the scoring (points per problem) known?

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

codeforces server seems to be broken same code giving diffrent output on my macinhe and server on my machine my code passes the same code while on server produces wrong ans i got 3 penalities due to that still not able to submit ..

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

Can anyone hack this solution 66706230?

UPD: Hacked, thx dead_blue!

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

How to solve D? I kept going in circles thinking about stack and non-positive difference...:(

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

    I can't tell you how to solve it in English, but you can check my solution, maybe it will help you. https://codeforces.com/contest/1272/submission/66702493

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

    Maintain 2 arrays, Increasing and Decreasing. Increasing[i] will store maximum increasing subarray till ith element, similarly Decreasing[i]. For each element check if (i+1)th element is greater than (i-1)th element, If true, then we can delete this element and updated ans=max(ans, Inc[i-1] + Dec[i+1]).

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

      Elegant Solution, can you explain why this holds?

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

      I didn't use this dp approach. The following is the algorithm I came up with. First find all strictly increasing continuous subarray and store each such subarray's start and end index as an interval. Update the max length for each interval.

      Then iterate through all intervals and check every two adjacent intervals and do the following. 1. if the current interval only has 1 element, remove it, get the next interval if possible and check if the previous interval and this next interval can form a longer strictly increasing subarray. Update max length if necessary.

      1. else if the current interval has more than 1 element, 2a.if the previous interval has more than 1 element, remove the last element of the previous interval and check if the previous and current interval can give a better answer. 2b. else if the previous interval has only 1 element, remove the first element of the current interval and check if the previous and current interval can give a better answer.

      The above solution fails on test 14 by a difference of 1. Can you help explain why this solution is incorrect? My submission is 66729847. Thanks!

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

        Your idea is almost same as me.

        I stored all strictly increasing sub_sequence block.

        Then updated result by comparing all block size.

        After that i took 2 consecutive block each time. If 1st block has size > 1, then we compare the 2nd element from last of 1st block with 1st element of 2nd block. if a < b then we have a length of block1+block2-1. Similarly i checked by ignoring 1st element of 2nd block.

        https://codeforces.com/contest/1272/submission/66754733

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

          Yeah, I think our idea are similar in general, except that I made the mistake of comparing value with index in one of the if statement, if only I could realize that during contest :(

          Thanks for replying though, without comparing your code I probably wouldn't even realize that bug in my code.

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

    do dp. dp1[i] = maximum length of increasing contigous subarray having the element of i from 0 to n. dp2[i] = maximum length of increasing contigous subarray having the element of i from n — 1 to i. Find out max length of subarray without removing element.Initially, this is the ans. And then, for every i from 1 to n — 2, check if(dp1[i — 1] + dp2[i + 1] > ans && v[i — 1] < v[i + 1]), if yes, then ans = dp1[i — 1] + dp2[i + 1]. That's it.

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

    Let pre[i] be the maximum possible length of strictly increasing contiguous subarray of array a from index 0 to index i

    Let suf[i] be the maximum possible length of strictly increasing contiguous subarray of array a from index n — 1 to index i

    Loop from i = 1 to n — 2, if a[i — 1] < a[i + 1], then ans = max(ans, pre[i — 1] + suf[i + 1]).

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

    very similar to this problem: PIBRO

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

    This AtCoder Problem is also an interesting one that you can solve using the above technique:

    GCD On Blackboard https://atcoder.jp/contests/abc125/tasks/abc125_c

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

    I've made a string of 0 and 1 of length N-1, where 1 means $$$a_i < a_{i+1}$$$.
    Then applied a regex / 1+ 0 1+ /x, and checked elements near matched 0 if they increase after one deletion (i.e. if exists $$$j$$$ that $$$a_j < a_{j+2}$$$, where $$$j$$$ is near 0). Perl code 66779749.

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

How to solve F? LCS and some post-processing?

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

    No, it is dp.

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

      I tried dp, but tbh, backtracking in dp made it quite implementation heavy.

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

        Same feels. I coded a dp solution with backtracking for around 240 lines. Couldn't fix the bugs within the contest time. Got it accepted after contest.
        You can find my submission here.

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

    Simple DP in $$$O(n^3)$$$. Notice that the answer's length cannot exceed $$$400$$$ and do dynamic programming. $$$dp_{i, j, bal} = $$$ minimum total length of the string with the first $$$i$$$ characters processed in the first string, $$$j$$$ first characters processed in the second string and the current balance is $$$bal$$$. Transitions can be made in a straight-forward way (nested loops) but you should do them carefully or by bfs/recursion.

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

      Out of curiosity, is there a solution faster than cubic, or is the n^3 solution the fastest intended solution?

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

    Actually, because problem limits were low, I just used dynamic programming.

    My state was (current unincluded character from S, current unincluded character from T, current bracket prefix). For some reason that I do not quite understand, the bracket prefix will not go above 200 and thus my state is 200^3=8000000 which is good.

    My transition is "add open bracket/add close bracket" depending on whether they are possible operations. I store which transition is better so that I can backtrack later to construct the bracket sequence.

    It passed the tests, so I think it's probably correct, but that was one of the ugliest case-check DP I have ever coded. Very unlikely to be official solution.

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

Any hints for E?

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

    Multi-source bfs on the transposed graph.

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

    Take 2 additional nodes, and reverse the graph...Think about it afterwards.

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

    Form a graph from a[i]-i to i and a[i]+i to i.(a[i] -i >=1 , a[i]+i<=n) traverse the adjacency list and insert points on the other side of the edge in the queue if parity of both points are diffrent. (these points will have minimum distance which is 1). perform bfs.

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

      Hello ; I constructed the graph in the same way ; but then I was doing DP on this graph...

      What I did was that let say node u has immediate child 'v'. Now if parity(arr[u]) != parity(arr[v]) ; then ans[u] = 1 ( This means that we may reach from u to v using only 1 step ).

      Else ; from all children of node u ( Which will be all v ) ; we may find the answer to node 'u' as ans[u] = min ( ans[u] , ans[v] + 1 ).

      But this gives me WA. Do you know what might go wrong in this approach ?

      CODE

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

        There may be a cycle. So it might possible that you are not updated the current node and it calls again from its child.

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

          Could you please elaborate a bit..

          I understand that there are cylces. I understand the the child might have an edge that is directed back from child to parent ( Or in general from child to some ancestor ).

          Doubt : When we came to that child ; we will come only after visiting the parent ( ancestor ).

          So even if there is an edge from child back to the parent ; we won't go over there again as the parent is visited ; and we don't re-visit the nodes in dfs.

          Clearly I have not understood something ; can you please elaborate a bit more...

          Thanks !

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

            Let take a node having three children{p, n1, n2, n3}, and there is a cycle b/w p and n2. Now your value of p = min(n1, n2, n3}, but when you go to n2, p is already visited but its value is not updated as it depends on value returned by n2.

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

              Ah I see... So you mean that by this we will never update the value of n2 as it's value would have been updated via p ; but P is itself not updated yet as it will get updated in the backtrack move of dfs.

              Have I followed?

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

How to solve E. I thought of bfs + dp but couldn't implement.

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

There is no constrain in problem B that length of string cannot be zero. Empty space should also be taken as correct input. Attempting to use this testcase for hacking shows invalid input. Is this intended?

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

    There are no empty strings in every test and empty strings are not allowed to input at all. Seems like it would be better to mark this in the problem statement more clearly.

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

66723421 ohhhhhh, I should go to E when my D's solution is wrong that taken too much time to debug.

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

Am I the only one who accessed CF from http://m1.codeforces.com after solving A ?

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

    The main site did not open for almost 2hr.I thought Round will not be rated but since 2200 users solved d, i think it will be rated.

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

Every day I have headache there is got to be a CF round SMH.

and I think I'm the only person who solved E but not D.

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

https://codefoces.com not working during the contest and I was thinking that my internet stopped working wasted my 10minutes

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

The server was down throughout the contest. Did I only face the issue??

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

Organizers please make the contest unrated as the site was down during the contest.

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

I think the internet issue / connectivity was the problem and not codeforces "down"

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

Need help in E. I thought of the dp solution, i.e let's start visiting every element and finding whether the given conditions satisfy or not. 66716159

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

MikeMirzayanov it is a request. I wasn't able to access the codeforces website after 9 minutes and hence wasn't able to continue with the contest after a wrong submission of A. This is leading a drastic rating drop for me. It is hence my humble request that if it be possible then please do not allow for my rating to change. As a proof that I could have done it, I have submitted another solution of A with a minor tweak. It works just fine and I was ready with it after a minute of my wrong submission but wasn't able to access codeforces due to unavoidable circumstances. I hope you'll help me in any way if possible.

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

    Why you did not continue with any of the other options the management has given ( m1 , m2 , m3 websites ) ?

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

i got a small problem in my code in problem F if someone can help me i just did dp[curr positions in s1][curr position is s2][diff between open and closed brackets] i will represent it as dp[curr1][curr2][val] i can made transitions just if after the transition the val will stay non-negative and then i know the length of the answer is less than or equal to 400 so if length > 400 or the val is > 200 i will just return inf that is my first submission 66726623 which just returned inf and that is my other submission 66727771 which i just return when siz > 1000 and it got accepted can someone explain the what is the problem please ?

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

Thank You vovuh I Loved this contest and I Love Div Three <3

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

Please give hint for F.

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

    Think of a dp with transitions similar to LCS and more state parameters.
    You can find my submission here. :)

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

I felt F was implementation heavy for those who are comfortable with top-down dp, especially the backtracking part.

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

If you can't wait to see the official editorial, come to see My Unofficial Editorial :)
Like to see comments and responses from you guys!

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

    I think A can be solved on much easier way.

    just calculate sum of current distance from given input. Let say it d. Then max(0,d-4) is answer.

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

    Movement for friend who is in the middle doesn't make any change. Moving left one right will reduce distance by 2 similar for right one. You can reduce at most 4. Finally check reducing making it negative or not.

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

Can anyone explain how to approach problem B?

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

    Hint: Try the move in a rectangular path.

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

    If you go one step right then you also need one step left to come back ,similarly for up and down ...another case is if you can't move up of down then you can't move left and right more than 1 ..hope its enough for this problem

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

How would you do E? I tried BFS with adjacency vector, but no avail :(. It gives TLE on test 8.

UPD 1: I tried again this time with an array that stores the closest node with opposite parity to make my code faster. Also TLE on test case 8.

66742260

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

    After moving to position 10, you can make 1 more move to position 6 (10 — 4 = 6), position 6 has value 5 which is odd. So that is why the answer is 3.

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

      the answer for 10th position is 1. the answer for 8th position is 3 because : first you move to (8-4)=4th position which has value 6 which is also even (val(8)==4) so you have to move again to pos (4+6)=10 which has value 4 . then you move to pos 6 which has value 5 that is odd . 3 moves

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

"Can't read or parse problem descriptor"-Anybody else having this problem?

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

what is the idea for problem D

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

What is the logic behind problem E

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

I still can't figure out why this code gives a negative result for problem A.

Somebody help me finding the bug which I can't find. Here's the code 66703687

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

    Changing your array decltype from Long[] to long[] gave AC

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

      I just noticed something like that for my very first time. It works for values to 127. But after that from 128 it doesn't check the equality normally. For example,
      1
      127 127 127
      This test case goes fine. But

      1
      128 128 128
      This doesn't go fine.

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

        Don't compare objects using ==. Use equals().

        Java has a cache of numbers in range [-128, 127], that's why small tests work.

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

      I use Long[] instead of long[] when I need to sort the array so that it sorts in guaranteed O(nlogn) time complexity. For primitive array java sometimes give O(n^2) time complexity for almost already sorted array. That gave me TLE in a previous contest problem.

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

        Why are you so worried about time complexity when your array has length only 3.

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

    You can not compare two object Long using != always.

    You can look here for details

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

Can I know why I got skipped

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

My rating should have increased by 9 according to CF Predictor but instead it decreased by 5??

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

when the editorial will be published...??

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

Is there some error in rating change? The rating predictor predicted a +102 while I got only +74. How such a huge difference?

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

Low tests in D problem :( My submission got passed but then failed at test 39.

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

Автокомментарий: текст был обновлен пользователем vovuh (предыдущая версия, новая версия, сравнить).

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

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

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

    The editorial update at the top is looking a little weird and confusing as compared to other contests' blog.

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

      I pinned it at the top because I thought that it would be more visible. If it's weird I'll post it as usual at the bottom. Sorry.

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

        Yeah I think that'll be better of you post it at the bottom. Just that I have been used to looking at it at the bottom, and I believe other people too. That's why I found it weird.

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

Problem D is very similar to this problem.

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

Screencast of my testing is available

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

please help to find out what's wrong in my solution of problem E https://codeforces.com/contest/1272/submission/79720918