Автор awoo, история, 6 лет назад, По-русски

Привет, Codeforces!

В 21.05.2018 17:45 (Московское время) состоится Educational Codeforces Round 44.

Продолжается серия образовательных раундов в рамках инициативы Harbour.Space University! Подробности о сотрудничестве Harbour.Space University и Codeforces можно прочитать в посте.

Этот раунд будет рейтинговым для участников с рейтингом менее 2100. Соревнование будет проводиться по немного расширенным правилам ACM ICPC. После окончания раунда будет период времени длительностью в один день, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено 7 задач на 2 часа. Мы надеемся, что вам они покажутся интересными.

Задачи вместе со мной готовили Адилбек adedalic Далабаев и Владимир vovuh Петров.

Удачи в раунде! Успешных решений!

Поздравляем победителей:

Место Участник Задач решено Штраф
1 Benq 6 143
2 crhkr 6 202
3 mjhun 6 210
4 nhho 6 210
5 krijgertje 6 223

Поздравляем лучших взломщиков:

Место Участник Число взломов
1 step_by_step 248:-25
2 greencis 31:-6
3 zero-light-some 15
4 Necrozma 12
5 Codefocres 11:-1
Было сделано 703 успешных и 490 неудачных взломов.

И, наконец, поздравляем людей, отправивших первое полное решение по задаче:

Задача Участник Штраф
A dotorya 0:01
B dotorya 0:03
C dotorya 0:10
D Benq 0:21
E ThePilgrim 0:07
F Deemo 0:49
G Marco_L_T 0:44

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

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

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

Finally, educational round, I miss you!

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

I love this round. As, educational, it teach me a lot.

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

What happened to BledDest? I have not see him in any educational contest for a while.

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

    He just got a bit busy with his exams at university. Might be back soon when they are over.

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

Участники выше рейтингом 2100 указываются как официальные участники.Это так должно быть ?

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

    Да вроде всегда так. Они официальные участники, но изменения рейтинга не получают.

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

What is an educational round? How is it different from a normal one?

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

    It is meant for we to try multiple types of problems, even if they might not be very original. Each problem has not a specific score, but rather is just the solving time that makes your score. This means that, for example, solving A+B+D and solving A+B+C within the same exact time will give the same score, even if D might be more difficult than C. Finally, hacking is not enabled during the contest, but a long (12-24 hours) hacking phase takes place after the contest. After that, system tests are run, as for normal contests.

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

Please, choose more comfortable As, Bs and Cs in future rounds, so that they're not just silly implementation problems :)

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

The third lucky number,

It's palindrome number,

Double the sum of it's digits equal to any digit of it square,

The number which product of it's digits equal to any digit of it square.

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

What about div.3 ?

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

    There is one line in bold in the post, read it again, it answers your question.

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

      Sometimes even bold is not enough for some people to see. They need bold header.

      rated for the participants with rating lower than 2100
»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Are the problems easy?I'm new in here.

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

    See the problems of previous educational rounds. Then you can get concepts about how the problems are

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

Educational round always enjoyable to me. I love to participate in the educational round.

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

Thanks all the authors to put the great effort and valuable time for preparing this educational round, these rounds are very helpful for learning.

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

Can't you delay this contest by two hours awoo

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

Are tasks sorted in difficulty order?

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

Wish everyone high ratings :D

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

First educational round rated for purple :)

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

aaand 10 mins delay :/

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

Rly?

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

Вероятность того что будет задача на теорию чисел?)

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

That moment when the round gets delayed and you suddenly have 10 minutes but you don't know what to do with them.

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

What is test case 7 in C?

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

Approach for C? I had thought to take the lowest number as one barrel with the least vol and then take another barrel such that a[i]-a[0]<=l and ai is maximum. Now if we have n-2 numbers between these such that a[0]<=a[j]<=x then we have an answer otherwise 0. Is this approach correct?

PS I failed on TC-#7

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

    Well, you can't do that. Because solution isn't optimal. What you need to do (I did it in this way, maybe there are easier ways) is find maximum number p such that a[p]-a[0]<=l. Then, from p to what number left, "erase" numbers bigger than a[p] (make them join group where a[p] is last element) so res+=a[p] for every decreasing p that has numbers bigger and not used. (sorry for bad english..) When you finish with the big numbers. Go from i=0 to remaining numbers that you didn't used. And that's it. I hop you at least understand something. Check my submission for more details.

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

    maybe the number of a【i】will exceed n-1

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

Why is hashing needed in F?

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

Hello, can somebody explain the solution for F (Isomorphic Strings)? My guess is some form of hashing, but I could not come up with a way.

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

    You need segment tree, but I don't know why do we need hashing. Isn't it enough to just check if length of sets is same or not? Appreciate counterexaple

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

    Your guess is correct.

    For a given query {x, y, len}, find the first occurrence of each letter which is after position x. Now if this occurrence is after position x + len - 1, we ignore it. Otherwise, let's say the position is x + p, then we know that f(s[x + p]) = s[y + p]. This means that the occurrences of character s[x + p] in s[x, ..., x + len - 1] should be on the same positions as the occurrences of character s[y + p] in s[y, ..., y + len - 1].

    Well, to check if these positions are actually the same, we can keep an array c[letter] for each letter where c[letter][i] is 1 if s[i] = letter and 0 otherwise. Then, using polynomial hashing on these c arrays gives us a O(1) comparisons of the occurrences.

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

E was such a nice problem.., although was unable to do it during contest!!

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

Problem D. — I thought h1 was a typo in h_1 ≤ H: no sand should go over the fence; because of the no one clause, but as reading whole statement and asking to judge, turns out it wasn't ;'(

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

    you could have sent question if you weren't sure.

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

    Wait, so only the first pillar has to be less than H? The rest can be greater?

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

    LMAO, now I know why my solution was wrong

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

    I think it isn't clear, but you should check that "h_1" <= H. If there were an example 1,2,1,0(H=1), It would be good.

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

    Honestly, I don't really see any problem with this line. The formula says the right thing, the description extends it meaning. I probably could have added it to notes, I agree.

    Chelslay says the right thing, you should have asked earlier if you thought we made a typo.

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

      Oh, I added a couple words now, by the way.

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

      Yeah, I also have to admit that I didn't read the statement carefully. What I'm sad is that I asked for it so late. If there were more time, I could solve it. ( since I got AC just before ;) )

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

for D, first condition that watched me h[i] <= H first time, after get WA on 7, h[1] <= H

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

ideas:

E: Sort, now the boxes can contain consecutive elements so we can dp

F: Let's calculate the hash for each character using a segment tree.

G: Sum the ranks of all possible teams (i,j,k), then for every edge (u,v) subtract the rank of (u,v,k) for every k. Finally add the rank of (u,v,w) for every triangle (u,v,w) in the graph

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

    Read accidentally, got spoiled. :o

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

    D?

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

      Run two binary searches. one for 1,....,K and another one for K + 1, .... LARGEST_VALUE, ... K + 1

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

        I currently submitted a solution only by mathematical manipulations, previously I was squaring a number bigger than 1e9.38513673

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

          Oh, wow. That's a very impressive approach! Thinking final sequence as symmetry first, and removing redundant tail part. I really learned many things from your code. XD

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

          Hey! Can you explain what you did ?

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

            I firstly calculated the max height I can reach such that I have enough sand bags to come down, then I calculated how many sand bags are left from reaching that height and then coming down to the ground . After that I calculated the length of the plateau by diving the remaining bags with max height and if now there is some remaining bag , I just increase the answer by one because that can be compensated by a dual move of that height when we reach that height while coming down. We can prove that it will always be equal to one of the coming down heights.

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

    Can you elaborate how to dp in E please?

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

    Hash can also be calculated by maintaining a prefix array of hash

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

is it rated?

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

E solution... wrong.... so sad.... :( Is it rated...?

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

Can someone explain their solution for E? I was thinking about something involving cliques but couldn't figure it out.

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

    first sort all numbers, now you just need to group consecutive elements, we can use dp to solve this problem. Let dp[i] indicate whether the first i elements can be successfully grouped, dp[i] is transferred by dp[l] | dp[l + 1] | ... | dp[r — 1] | dp[r]. l, r is the interval endpoint that makes dp[i] exactly satisfy condition, As i increases, l increase, r increase, so you can use deque to maintain.

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

Is finding all triangles in a graph something well known to the community? I managed to find this which works in O(M3 / 2) but this is my first encounter of this algorithm.

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

    It is an standard task. There is a simple sqrt-dec algorithm.

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

      Can you give me some hint / any tutorial about that algorithm?

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

        If you have time, you can just wait for editorial.

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

        I came up with this algorithm:

        Let's call a vertex heavy if it has degree >= sqrt(M).

        Let's call a triangle heavy if it contains at least one heavy vertex.

        1. We can count the light triangles as follows: Iterate over all edges (u,v) were both u and v are light. Now for every light vertex w adjacent to u, check if (w,v) exists in the graph.

        2. For heavy triangles, let's iterate over every heavy vertex u, and mark its adjacent vertices as visited. Now for every edge of the graph check if it has both of its endpoints visited.

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

How to solve C ? I got WA on test 8 :(

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

    Sort. The first element (in the sorted array) will be taken for sure so, find the maximum array index which is less than or equal to (first element + l), if there are less than n elements then print 0 and exit. Else, starting from this index move backward and pick greedily such that there are enough of elements ahead of it. Hopefully, it is correct.

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

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

OMG, in problem D i thought i CAN NOT make pillar higher then H...

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

Why everyone is doing hash for F? There is a 24-hours hacking phase await... (don't know if random power base can save us from this)

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

    Is it possible to hash large subsets with one modulo? I thought about this during the contest but decided that collision probability would get too high...

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

    Can you explain your solution ?

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

      It works like this:

      First we replace each letter in S with the distance to the nearest same letter on the right, or ∞ if there's no such letter. E.g. "abacaba" becomes [2, 4, 2, ∞, 2, ∞, ∞]. This takes O(n) time. Now instead of a sequence of letters, we have ≤26 interleaved linked lists — one for each letter type in S.

      If substrings X and Y are isomorphic, then all elements of linked lists that form X must be identical to those which form Y, except the last elements, since they point outside our region of interest.

      Therefore, X and Y are non-isomorphic, iff there is an index i, s.t. X[i] != Y[i] && (X[i]+i < len(X) || Y[i]+i < len(Y)). To find i, we quickly (using a lcp array) iterate over all j, X[j] != Y[j] and check X[j]+j < len(X) || Y[j]+j < len(Y). We will do at most 26 iterations, because X[j]+j >= len(X) means that j was the last occurrence of the letter at j.

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

[PROBLEM C] Could you tell me where i wrong? My solution got wrong answer on pretest 6 https://ideone.com/Xfb3Ek

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

Problem E was a subtask of this problem : Here

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

38507649
I made a stupid mistake in 985F - Isomorphic Strings.
Come and hack me >///<
But I still love ♥ 127 ♥

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

Can you believe it, I assumed that the positions in A were sorted. Couldn't figure out this till the end and got WA. Not complaining, but the examples could have been 'unsorted'? :(

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

    Same for E, (cost me one WA) but to be honest it's up to the contestants to read the problems carefully.

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

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

How to solve E? (My greedy solution got hacked)

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

Seems that uwi is on a killing spree for Problem F...

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

    I tried to hack solutions of rolling hash of 2 const modulo after waking up, but the contest had finished.

    To hack rolling hash by 1 const modulo is very easy by birthday attack.

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

how to solve D?

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

1000000000000000000 1 For this case how the answer be 1999999999

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

    1 2 ... 999999999 1000000000 999999999 ... 2 1

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

      no sand from the leftmost spot should go over the fence; What does it mean then?

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

        Only h1 must be less than or equal to H (so that it doesn't get over the fence). For other pillars they have no restriction on their absolute heights; their heights only need to have at most difference of 1 to their neighbors' heights.

        I've been thinking wrong about this during the whole contest, and I had no idea why I was getting WA on test 7. Now I feel really bad that I couldn't realize this :(

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

          Okay, then why the answer to the case 20 4 be not 6? here 1 2 3 4 5 5 = 30.

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

            1+2+3+4+5+5=20.

            If 1 is your h1, meaning that it is the pillar that is leaning against the fence, then the other side has to descend from 5 to 1. It can't just stop at 5 abruptly.

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

          I got 5 wrong submissions because of this. Luckily I realized it during the contest. Misreading statements is one of my specialties.

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

Why are "acc" and "cac" not isomorphic for problem F?

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

    because it is not bijective. f('a') = 'c' and f('c') = c(for 3rd character of 'aac')

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

Anybody idea for E.

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

    Code

    My solution for E:

    first we sort all pencils.

    we define dp[i]: is it possible to solve problem for pencils 1 to i.

    and d[i]: greatest j (j <= i) that dp[j] = 1.

    now we put x = d[i — k] and after that if a[i] — a[x + 1] <= d then dp[i] = 1 else dp[i] = 0.

    and d[i] = i if dp[i] = 1 else d[i] = d[i — 1].

    (sorry for bad English)

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

      Why are you taking x = d[i — k]? Can you elaborate more on that?
      UPD : Got it NVM.

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

        In last box there are at least k pencils so we have to find rightmost j that
        j <= d — k and dp[j] = 1 now check that pencils j + 1 to i can be in one box or not?

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

      In Problem E,why is that if a solution exists, there exists partitions such that they form contiguous segments of the Array.Thanks in advance .

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

        First we sort the array so in each partition (max — min) will be minimize.

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

    -sort the array

    -find a slow dp solution : O(n^2)

    -try to optimize it to a faster dp solution : O(n * logn) or O( n )

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

D was the worst possible type of tasks for me. It's a pity it appeared in the contest, even more that it was placed before E, which was quite easy for me.

Also I'm not sure that the round should be rated as I started coding D because at the time of making a decision, E was not solved by anybody (so E appeared to be harder than D), due to the error. Issues in E had impact on many participants. I believe I got 3 problems instead of 4 due to that.

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

    Wait, this happened about half an hour into the contest. Wasn't that your fault to spend the rest of the time on the problem of your weaker topic instead of reading the other ones? I'm sure that the ranklist after half an hour tells nearly nothing about the difficulties of the problems.

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

      I checked more precisely. At the time I was looking at the next task (after solving C), there should have been 23 E solutions accepted already, this was the last one:

      http://codeforces.com/contest/985/submission/38494892

      At the same time there was 0 accepted solutions to E and there were 11 accepted solutions to D, the last one: http://codeforces.com/contest/985/submission/38495105

      I have no reason to lie, as I said I expect a positive rating change. If I had seen these numbers when I was making a decision I would have started with E.

      I just have a feeling that the issue with E is sufficient to make this contest unrated. I was impacted indirectly but many people were impacted directly.

      Besides — there was incorrect author's solution, this fact should make the whole round unrated, given ACM rules. I object to policy of making rounds rated just to please the maximum number of people. Rounds should be unrated unless they ran perfectly in 100%.

      What do you think MikeMirzayanov?

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

      UPD: My fault... See comments below.

      Well, it is a good round ... but problem D. (No offensive).

      Even though problem D itself is a good one, but it is not very friendly to the CPPers.

      We need to handle two long long multiplication carefully. ( Aha! I know it! I avoid this! )

      And then math functions bring floating errors! ( WHAT? TIM_20180519215120)

      Should "handling floating errors" really be the part of the contest?

      My key point is : D is a good problem, but it shouldn't make certain languages better than others.

      (Making D's limit into 109 would be a better choice, I don't know any brute force that can pass 109 but not 1018).

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

        We had a solution and didn't really want it to pass. It's like one step easier than the intended one.

        All calculations in my solution are performed using only integer types and fit into long long.

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

          Thanks for replying.

          We had a solution and didn't really want it too pass. It's like one step easier than the intended one.

          OK, then I have no problem with D's limit.


          All calculations in my solution are performed using only integer types and fit into long long.

          So, you mean that long double is intended to fail ? Should "using long long instead of long double" be a part of the contest ? Maybe it should be but I don't know ?

          Really, worst time ever : getting WA on test 7 but the logic of the program is absolutely right, struggling whether to submit again or to give up.

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

            If you have to multiply numbers that big then you are doing something wrong? I mean, use long double as much as you want to if you are sure in the correctness of the answer you get. Or you can think a bit more and get a much smaller estimation on the borders of binary search.

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

              No, not that, I said I avoid long long mutiplications.

              I got WA using ceill(n/X) but AC (preliminary) using following code:

              for(; n>0; n -= X, ++Ans);

              I don't think it is wrong using ceill(n/X).

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

                Actually, you output 2e+009 instead of 1999999999. Maybe this was the problem, not the precision of calculations?

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

        I pass it using long double...(after contest q_q)

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

      To make it more clear — maybe it wasn't understood for the first time.

      If there were no issues, that would have been my fault 100%. However in this particular case, my decision was biased by the bug in writer's solution.

      I also think that it might be the case with more people as the difference in accepted solutions between D and E is very small, while it should be something like 250 for D and 450 for E, but I guess that many more competitors jumped to D as they saw that nobody was able to solve E for almost an hour.

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

        Most people also do the problems in order because they expect them to be in order of difficulty.

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

    The worst excuse ever.

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

      It is not an excuse as I will probably get positive rating change after this contest (at least this was my knowledge when writing this post)... And I'd rather give it up for unrated round as I feel that this contest was interrupted by the bug.

      It just demonstrates the subtle impact of the issue. I based my decision on the number of problems solved and I got stuck on D until the end of the contest and I have a reason to believe it would not have been the case, but for the mistake.

      As regards previous comment — it is not true. After 40 minutes I should have seen comparable number of solutions to both problems. If I see around 30 solutions on D and 0 on E, it is a clear indicator for me that D should be easier than E (not everyone should follow this logic).

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

Why I got RUNTIME_ERROR in pretest 7? 38505110

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

    The error is caused in this line:

    while(cnt && abs( *(s.rbegin()) - *L ) > l )

    You are trying to access to the value pointed by L, but a few lines before, you erased that value from the set. I saved *L in a variable before deleting it from the set, and the Runtime Error was gone, but now it gives Wrong Answer. I'm not really sure what's the idea behind your code, so I can't help you with that. I hope this comment helps you solving the problem :)

    PD: there is another error in that line: you forgot to check that the multiset is not empty before trying to erase an element from it. That may cause Runtime Error too. Bye!

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

can anyone help with some good test example for problem E ? I have made the code but unable to understand where it could go wrong. #noob

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

can anyone help with a good test case for problem E ? cannot Figure out where it could go wrong. #noob

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

Hi, I just wanted to mention that it seems that users with rating above 2100 are registered as official contestants... or at least they don't disappear when I unset the "show unofficial" checkbox.

Hope that doesn't causes any problem.

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

    Educational rounds are rated for users with rating below 2100, but it doesn't mean other users are unofficial. I think, In those rounds all users are welcome to participate officialy.

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

In contests page, the hacking phase for this round seems to be for 12 hours rather than a day.

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

Problem D is similar to SRM 721 Div1 Easy.

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

For problem F,if the size of alphabet is up to 10^5 or larger and other constraints remain the same,is there any approach to solve it?

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

Can anyone tell me Problem F why my solution get WA on test 16's 9259th query? I have been debugging for more than five hours. qaq. this is my submission code: 38512729

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

As a novice, I have a question for everyone. Why did I submit the same code twice, but one got AC, another got WA. 38509969 during the game. 38524984 after the game

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

Problem C:Why I got TLE Verdict?38494646

I didn't use while() so there are some troubles on sort?

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

System test has finished,so is it rated?

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

when will the editorials be updated?

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

The rating were changed so it's rated

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

does hacking a solution not effect our rating

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

Is there any solution for F except O(N * 26)?

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

What is GNU C++17 Diagnostics (DrMemory) ?? Can someone tell me ??

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

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

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

Thanks for div2 only contests !11!1

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

__i use ideone to run the code but the solution is copied and i get unrate. Does my computer have malicious code? Explain me, please.

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

Where is the editorial ?

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

Где разбор?!

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

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

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

In Question C,I had got time limit exceed in test case 19 in java while with same algorithm (same code) in C++ is able to pass all test cases.

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

In problem D,

when I use round() function to round the division operation to nearst integer value it causes me WA in testcase 18 though the round function isn't making any difference!

accpeted sol: http://codeforces.com/contest/985/submission/38600567

wa sol : http://codeforces.com/contest/985/submission/38600584

round() is not making difference: http://codeforces.com/contest/985/submission/38600633

and all of this solutions provide correct output -1 in my local machine!

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

Thank you.