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

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

Привет, Codeforces!

Мы с Artyom123 и Kotehok3 рады пригласить вас на Codeforces Round 671 (Div. 2), который пройдёт в 19.09.2020 17:35 (Московское время). Этот раунд будет рейтинговым для всех участников, чей рейтинг ниже 2100 (По крайней мере мы очень на это надеемся).

Мы хотели бы поблагодарить:

У вас будет 2 часа на решение 6 задач, одна из которых разделена на простую и сложную версии (ну или чтобы поиграть в Valorant, которому и посвящён этот раунд по какой-то никому не понятной причине).

Вам придётся разбираться с проблемами агентов из вселенной этой игры, чтобы получить заветный плюс к рейтингу. Помогайте им так, как будто это ваши союзники в рейтинговом матче!

gl hf

Разбалловка задач: 5007501250(750 + 1000)22503000

UPD: Разбор

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

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

I hope that statements are short with strong pretests.

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

"This round will be rated for all participants, whose rating is lower than 2100 (We really hope so)."

:(

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

You must remember — peaker has an advantage!

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

The first 6 problem round in such a long time!

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

That day will be my birthday, I hope i can do well on that contest and make the day more memorable...

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

I hope that Dindic`s algorithm will be in the round

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

Храплю как гаст

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

Можно раунд по кс?(

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

Tired of posts about short statements and strong pretests

So what if statements are long? So what if pretests are weak? Everybody is in equal position and competitive spirit does not waver. For all I care you can remove all pretests and I will gladly participate anyways.

What I really need is short queues and strong/correct checkers. And if I can ask for more, then give me an appropriate editorial

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

    Removing pretests will definately make queues shorter! :D (Ofcourse we won't do that)

    As for the tutorial, we will try our best to make it as understandable as possible.

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

    some old Codeforces problems have weak pretest causing high amount of hack which cause some lucky people can get free 1500 point by spamming "0" zero in his room

    https://mirror.codeforces.com/blog/entry/59431#comment-430573

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

    So what if pretests are weak? Everybody is in equal position

    I really disagree with this. Yes, everybody gets the same pretests. However, people are hurt differently. Some people (me for example) rely on strong pretests for problems like A and B. These problems usually have multitests and generating strong pretests isn't that hard. Others are careful and don't trust the Pretests Passed verdict. They will still check their code for logical/implementational errors and corner cases. Clearly, strong/weak pretests makes a huge difference for these two types of people.

    Removing pretests will definately make queues shorter! :D (Ofcourse we won't do that)

    shishyando this seems like exactly what you did. 1 pretest for A (not including samples) and around 70 systests for A (causing such a long queue that systests still hasn't finished). I FSTed A, and I didn't want to wait for all the systests to finish so I decided to stress test myself (by copying an AC submission). Turns out that my program messed up the parity of each position when n is even. However, to my disappointment, such a submission (surprisingly) passes all the pretests. I am interested as to why the for pretests for A are so weak. An easy solution would be allowing 1000 tests and have the first 100 be max cases (to check for tle) and the rest be randomly generated binary strings of length from 1 — 10. Another option is to just generate all binary strings of lengths 1 — 9, in addition to max cases. Both seem really easy to implement and I'm curious why you didn't do so.

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

      I had to make a single pretest in A (except the sample) to avoid long queues. The pretests were made randomly, and I thought that it was strong enough. We didn't find any problems with A's tests during the testing phase.

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

        Even with 1 single pretest in A, you can still easily make strong pretests. Allow there to be 1000 cases, guarantee that the sum of n doesn't exceed 2e5, and make each case small to better account for various corner cases. The issue with problems like A is that special cases only appear when there are no even/odd numbers in all even/odd positions. Thus, randomly generated large tests are very bad at "hacking" solutions. Also, shishyando what is the thinking behind having 70 systests for each problem? This is the slowest systest I've ever seen and it seems that a lot of the tests are unecessary.

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

      I would've argued that I'm don't mind exchanging strong pretests for more algorithmic questions, but it seems there is not much to exchange.

      I understand not wanting to waste time on A&B. I myself managed to pass pretests with an incorrect checker for that very reason ^_^

      Of course it would be a different game without pretests, but I would play it anyway. People would work on their solutions more rigorously and really try to prove it before submitting

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

    I did not care about weather the statements were long but the pretests on C should have been stronger. I failed it on test 61. Also from what the test case constraints were clarifying the ratings of an individual could only be in the range [-4000,4000] to which I based my solution on and that is why it did not pass. You would tell me "well why did you not ask for a clarification" well the answer is because my submission passed all the pretests thus I imagined that that was the solution.

    I have no problem with the problem statements being long. 0 problem. But the pretests must be strong.

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

VALORANT!!!!!!

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

Clashes with ioi (

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

Gamers joining Codeforces because of Valorant .

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

Normal Div 2 Rounds: Score distribution will be announced shortly before the round. Div 2 Round 671: Here is the score distribution Meanwhile other testers: Are we joke to you?

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

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

As a tester I recommend you to read all the problems.

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

Thank you problem setters and testers for taking the pain to arrange the contest.

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

I can assure you. ;-)

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

One other thing I couldn't care less about is the score distribution. Seriously, why people always talk about it?

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

Hoping to become expert in this contest.

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

" A problem has an easy version and a hard version. " This hasn't happened in a long time, I'm waiting.

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

Oh, score distribution is cool. Hope the problems will also cool and there'll be no issue with the problems like the last round.

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

A very unique and interesting rating graph shishyando xD

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

Hope Retired_cherry will change some problem in the last few minute, and some guy will solve it in 1 minute.

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

As a tester, I can confirm that problem statements contain words.

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

Wasn't scoring distribution supposed to updated only 5 hours or so before the contest?

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

we want a contest that is related to pubg!!!

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

Why is the fourth one 750+1000 instead of 1750? Is that intentional?

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

CS:GO themed contest when? :p

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

Subtasks! After a really long time.

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

Subtasks! After a really long time.

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

Super excited :D

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

When are we planning to have another Codeforces Round 657 (Div. 2) type of round, which was a nightmare more me. Also are we expecting more mathematical problems in this round?

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

bol fy fca.

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

IPL starts today. Which team are you supporting today? #MIvsCSK

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

I'm looking forward to see "Score distribution is changed to * * * * * *

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

Sorry IPL, Not today.

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

(WhatsApp-Image-2020-09-19-at-6.00.00-PM.jpg)

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

The round is also clashing with Leetcode biweekly contest 35. Can there be possibly any change in contest time?

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

Who else is just waiting rn for contest to start?

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

I think Gamers are joining Codeforces because of Valorant :P

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

This will be the first contest I have ever done. I hope all participants have fun and challenging problems to solve and learn.

I thank all of you; authors for your time and energy.

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

Когда написал тупой коммент и смотришь на свой вклад: https://www.youtube.com/watch?v=pgRZpbT5w7k

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

I hope will not be like the last contest, because it was disappointment.

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

as a tester you will enjoy this round

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

I'm not sure about problem statements, after they say about the "Valorant" part. Hope to have good statements. :3

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

Understanding problems is similar to finding Among Us Imposter

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

god damn it I fu**ed up in A and B it could've been way better

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

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

    Can you please tell me how to solve D2 and E? Thank You very much.

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

      $$$D2$$$

      $$$D2$$$ can be solved in the same way as $$$D1$$$ — just place $$$a_{n/2+1}$$$ ~ $$$a_n$$$ and $$$a_1$$$ ~ $$$a_{n/2}$$$ alternatively.

      $$$E$$$

      $$$E$$$ can be solved like this: If $$$n$$$ has a divisor which is square number $$$k^p (k,p \gt 1)$$$ greater than $$$1$$$, find all divisor of $$$n$$$ (let's define these as $$$a_i$$$.) which is not the multiple of $$$k$$$, and order $$$a_i \times k^p, a_i, a_i \times k, a_i \times k^2 , \ldots a_i \times k^3$$$. Repeat this to get an answer, and the minimum number of moves is $$$0$$$.

      If $$$n$$$ has no such divisor, it means $$$n$$$ is equal to the product of $$$m$$$ ($$$2 \le m \le 9$$$) distinct prime numbers. And there will be $$$2^m-1$$$ divisor (except $$$1$$$), and we can consider those as combination of different prime factors — $$$b_i$$$ is multiple of $$$j_{th}$$$ prime factor of $$$n$$$ if $$$i \And (2^{j-1})$$$ is nonzero. Now we just need to rearrange the numbers from $$$1$$$ to $$$2^m-1$$$ so that the bitwise and values of all two adjacent enlements are nonzero. And for each number $$$i$$$, print $$$b_i$$$. The minimum number of moves is $$$1$$$ if $$$m = 2$$$, $$$0$$$ if $$$m \ge 3$$$. The rearrangement method can be found by considering the following sequence: $$$\left[1,3,2,0,6,4,5,7\right]$$$

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

Approach for C??

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

    First, check if the average distance from x for each element = 0. If it is, then the answer is 0 if all elements already equal x, else 1. Otherwise, if x is in a, then the answer is 1. Otherwise, answer is 2.

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

    you do it in atmost 2. the case for 0 is easy. 2 can be done by infecting (n — 1) elements while using the last one as offset and then infecting the last one while using any element as offset. The case for 1 was tricky and I did some guess work.

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

This round is too unbalanced. In A — D you just need to figure out the idea, and don't have to know any algorithms, and around 3500 people solved all of them, but E is probably too hard for div2.

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

    For A-D, I agree with you but E is definitely not hard. It's basic number theory and observations(constructive algo).

    Hint for E : Just find prime factors of the number and try to put the product of then any two primes in between those 2 primes. Obviously, you need to handle some corner cases like prime square or number is product of only 2 primes.

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

This was basically speedforces

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

Thanks for a "nice" B:)

I hope Codeforces employs some proof readers for the statements. The statements should be better.

Waste so much time in B that could not focus on C even when I kind of had the idea that max 2 answer is possible. Definitely my fault but the statements could have been better.

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

For problem C when can the answer be 1 ??

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

IS following approach correct for E!

find all factors then find all prime factors of it let all prime factor sequence be like a1<a2<a3. then first club all factors divisible by a1 together that is put them side by side then remaining factors divisible by a2 together then by a3 and so on I think then finding minimum answer required is easy!

Please correct me if I am wrong!

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

I don't understand why I fkd up D1 ;'(

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

Enjoyed the problemset. Kept me challenged till the last minute. Thank you!

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

deleted

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

    If you look closely a stair is valid only when the height of the longest staircase is 2^x - 1, x >= 1

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

      how do you even prove it? forget that how to even verify it ? it is inhumane to expect us to draw 15 staircase

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

        deleted

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

        True that! Very inhuman of me!!!!

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

        I did till 7. next in line had only two possibily 13 or 15 just tried the general terms of both the cases. They made me draw it :(

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

        Adding a proof to (B):

        Proving that 2^x-1 works is obvious: note that there is a big 2^(x-1) times 2^(x-1) square with one corner on the lower right; use this, and now we are left with two smaller stairs of parameter 2^(x-1)-1.

        Now suppose n is not of the form 2^x-1 and n is nice. Note that the minimum number of squares needed to cover the stairs with parameter n is at least n, because no two of the top-most cells of the n steps can belong to the same square. Therefore, each square in the decomposition of this stair should cover one top-cell in some stair. Furthermore, note that the bottom right cell and a top-most cell of any step do not belong to a common square except if n is odd, in which case bottom-most cell and the top-most cell of the middle step can belong to the same square. But this square splits the stairs into two stairs of parameter (n-1)/2. Now induct, and we are done.

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

          I really don't get it, can you please explain what is big ? " Moreover, if n is not of the form 2^x-1, then the bottom right cell and a top-most cell of any step do not belong to a common square. " did you mean bottom left cell and why should it be of the form 2^x -1 to fulfill that?

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

          Okay, so each unit square is a cell. Each column is a stair. A square is a union of cells that makes a square shape, as shown in the problem.

          Consider a staircase with n steps. We want to partition the n*(n+1)/2 cells into squares. Let f(n) be the least number of squares required to do so. Consider the topmost cell of each stair; there are n of them . Note that no two of these topmost cells can belong to a common square. Therefore, the answer f(n) is at least n, for all n.

          Suppose the answer is exactly n. Then, the n squares that partition the staircase must cover the topmost cells of each stair; you cannot have a square that misses all topmost cells of all stairs, otherwise we will need > n squares.

          Now, consider the bottom right cell. The square that covers this must also cover the topmost cell of some stair. For even n, this is impossible. For odd n, this is possible only when you take a square that covers the topmost cell of the middle stair and the bottom right cell of the staircase. But upon taking this square, we are left with 2 staircases of sizes (n-1)/2 each. This means

          f(n) = n => f((n-1)/2) = n-1/2. Thus n is nice implies n is odd and (n-1)/2 is nice. From this, you can conclude that n is of the form 2^x-1 for some x.

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

    u need to figure out the pattern of a nice stair.

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

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

B was more difficult than C +D combined for me, how do you even solve it?

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

I personally felt that this contest was more about getting the idea and passing the corner test cases. The questions were not in order. D1 was easy. In A, you could just check for the last digit depending on parity of it. For b, it was 1 formula (with a testcase gone wrong which I still haven't figured out). In C, a hit logic (with corner case where you have at least 1 of x in your set of 1-n). In D1, just print the nos like n, 1, n-1, 2,...(you get the idea).

Basically, all the questions could be done in a max of 4-5 lines. No data structure/ implementation knowledge was tested. the questions were good and interesting. But more so as a puzzle and not as a coding contest. Having 1 or at max 2 ques like that is okay. But if all questions are like that, the problem setters need to take a note of this.

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

only after system testing can you test right ?

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

please someone check my code for F, i have no idea whats the problem with the code, here is my submission it would be so good if you check my solution : ) https://mirror.codeforces.com/contest/1419/submission/93269063

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

wtf was b

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

My brute force idea for E was working in 3 seconds for number of factors=700. Any idea to optimize it to pass under 1s TL or a more elegant solution?

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

How do the ratings change in this testcase for problem C?

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

wtf was b

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

can any one why my solution for F is not working!? here is my submission it mean a lot if you find its bug : ) https://mirror.codeforces.com/contest/1419/submission/93269063

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

For E, I iterated over the smallest prime divisor, printed all the divisors of n that are a multiple of it from largest to smallest (besides n), and then printed n. Then, I divided n by the smallest prime divisor and recursed for each successive prime. This guaranteed that all adjacent elements weren't coprime, and I think maybe that the first and last elements aren't coprime (but I got WA). Can someone point out an n where this strategy doesn't work? All the ones I've tried work

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

Can anyone tell me why I was having TLE in problem D2 ?

My submission: https://mirror.codeforces.com/contest/1419/submission/93268164

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

All the questions could be done in 4-5 lines. No data structure/ implementation knowledge was tested. There were essentially two pretests for B-D, you passed one if you got the idea, and failed the other (they made those specific cases where you would fail, like for C, count of x >=1 in the set will give contest max 1 ans, you would print 2).

My point is, having 1-2 questions like these don't hurt. But when all the questions feel like this, something's wrong. In a div2 contest, we need more of algorithm/ data structure based questions, not the puzzle types. And because of the puzzle nature, the difficulty order of the questions did not correspond to the number of solves. I would request the future problem setters to please take a note of this.

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

D1 < A < B < C = D <<< E << F

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

Took me so long to understand C right...

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

I don't get how D1 and D2 were different. I barely made any changes to pass D2 after D1

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

    Exactly lol. After B I solved D1 in 10 mins and since it was too easy i thought it wouldn't work for D2 and went to C. After C when I thought more about D2 I realized all i had to do was calculate answer seperately

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

At first, I was surprised to see the submissions to problem D2 and C1 rising rapidly, this actually makes you panic when you have not solved the problem. But later I felt like someone fooled me. The problems were damn easy. Short statements strong pretests.

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

I couldn't understand A and B's English.It seems that I need to study English, not algorithms ...

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

Screenshot_20200729_205651_com.whatsapp2c900f4644ea10e17.jpg

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

What Problem B actually say

i read it many times but cannot understand that

Can any one say me what they actually want

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

can we solve B without searching on oeis. :)

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

    Draw out the stair cases. I did till 7 (1,4,7 were only possible) so next in line would be 13 or 15 just check for both the cases which one matches

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

    yes, look at how height of stairs is changing.

    starts with 1, and then height = (height * 2) + 1

    and they gave us the higher limit of this in sample. look at my submission for more help.

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

    I did. My approach — First I observed the pattern, nice numbers are 1, 3, 7, 15 ..
    this is enough to come up with formula f(i) = 2*f(i — 1) + 1. Also, if you observe how nice stairs are made, if number x is nice then you need to combine two stairs of type x with a middle square of length (x + 1) resulting in a nice stair of length 2*x + 1. Rest is simple greedy approach.

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

Wasted a lot of time in question B, Unable to get the Statement specially "n disjoint" but finally solved it.

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

Problem $$$A$$$: Digit FST Games

Goodbye, master~

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

Problem C: 4 38 -21 83 50 -59 can anyone just EXPLAIN me how answer is 2?

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

    See if a rating is infected then basically you don't care about it afterwards. So use it to make every other rating to infected.

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

      suppose I make A[0] infected, then how he will infected others ??

      in the statement, they said all changed need to be 0. then I need to decrease/Increase the same amount of rating from another one.

      can you please explain to me how it's happening? how he will infect others if I infected only one.

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

        So A[0] is infected, now make all non-infected rating equal to A[0]. For this, you have to increase or decrease other ratings. Calculate the net change and subtract that value from A[0], that's all, other ratings are also infected. See we can do this because A[0] is already infected, and it is mentioned in the problem statement that once a rating is infected, it will remain infected forever, So we change A[0] to any value to satisfy the other condition that, some of all changes in ratings after a contest should be zero. If you still didn't get it I can explain with an example.

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

    First contest ratings are [38, 38, 38, whatever] so you infect 3 people. And in second contest last person is infected.

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

    more simply you can get all ratings to x except for the last guy, and compensate it all on the last guy to make whole difference 0. and then do last guy, make him compete with any one and make last guy infected as he is the only one remaining. that is case for 2, (only 2 operations needed).

    if the last guy == x, he was already infected, that is case for 1 (only one operation needed) else 2.

    more formally

    all elements == x: output 0

    if (count x in array > 0 || sum == x) output 1

    else 2

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

Test Case 68 on A was nasty.

Also, there wasn't enough of a distinction between D1 and D2. They were both just basically greedy brute forces. I solved D1 without even looking at D2, and I then solved D2 by changing 1 line.

Overall, this was a bad round.

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

I did left the contest early because of bad statements A+B.

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

Thank you for your effort.

(750 + 1000) for D1 + D2, but each one of them is actually easier than B. In the previous contests, it is used to be counted as: if you solved D1 you deserve 750, then solving D2 gives you the complete degree because you solved the difficulty that deserve 1750. But today, you can get 1750 by solving two problems, each of them is easier than the problem that deserve 750 in this contest.

In other words, my mind used to think of D2 as 1750 not as 1000 or lower.

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

Please downvote this round!

List of problems

-A was badly written (all these FSTs on test case 68!)

-Distinction between D1 and D2 was insignificant, they were both just stupid greedies. Many people solved D1 and almost copy pasted their code into D2.

-No data structure/algorithms involved at all: just greedies!!

-Terrible scoring. Why was the scoring on E so high??

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

To be honest, D1 and D2 were much easier than even A. I didn't even look at D2. Just matched the test cases and submitted for both D1 and D2 and pretests passed without even changing a line.

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

Sad round... The description of B and C confused me a lot. The difficult of these problems is how to understand what author mean rather than algorithm.

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

Lots of people failing system tests on question A , test 61 and 68 mainly. Also, ordering of questions weren't that good. I do appreciate the efforts of the authors ,and testers, but many of us are kind of not satisfied.

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

Just a suggestion. Please next time make tight pretests. It really feels bad when you have think you have solved but after the contest you know that your problem A fails.

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

test 61 for A is awesome

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

Problem B is hard to understand to me that I waste a lot of time :(

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

Problem d is obviously easier than usual d. I thought D2 would be much more difficult than D1, but they’re actually the same.

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

B ruined the contest for me, I am not sure about the proof for a "nice staricase", but the proof is definitely not DIV2 level, and even the observation is not that intuitive for a "nice staircase" since there are only 3 samples (1,3,7) and it is inhumane to expect us to draw 15 staircase.

And IMO A+C+D1+D2 was much easier than B,A and C were good,D2 was too easy, was not able to even look at E, thanks to B

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

Today's contest in nutshell:

Untitled.png

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

This is the first time I have failed System Tests, that too on Problem A. Anybody knows why so many System Fails on A?
EDIT : Weak Pretests and a simple typo made you fail System tests.
Also D2 was greedy? Why? I was thinking greedy only worked for D1 and didn't even give it a thought on D2. A really bad/easy D problem for Div. 2. Only problem I liked was C.

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

Nowadays Problems Setters are emphasizing more on Problem statements rather than Problems.

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

Adding a proof to B:

Each unit square is a cell. Each column is a stair. A square is a union of cells that makes a square shape, as shown in the problem.

Consider a staircase with n steps. We want to partition the n*(n+1)/2 cells into squares. Let f(n) be the least number of squares required to do so. Consider the topmost cell of each stair; there are n of them . Note that no two of these topmost cells can belong to a common square. Therefore, the answer f(n) is at least n, for all n.

Suppose f(n) = n for some n > 1. Then, the n squares that partition the staircase must cover the topmost cells of each stair; you cannot have a square that misses all topmost cells of all stairs, otherwise we will need > n squares.

Now, consider the bottom right cell. The square that covers this must also cover the topmost cell of some stair. For even n, this is impossible. For odd n, this is possible only when you take a square that covers the topmost cell of the middle stair and the bottom right cell of the staircase. But upon taking this square, we are left with 2 staircases of sizes (n-1)/2 each. This means

f(n) = n => f((n-1)/2) = n-1/2. Thus n is nice implies n is odd and (n-1)/2 is nice. From this, you can conclude that n is of the form 2^x-1 for some x.

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

I've checked for the even position for the second person and got WA at 68. This is silly that this case isn't in Pretest. What a shame! It must be in the Pretest. What's going on in Codeforces! Shame!

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

Did you have some kind of intention to prepare such a large number of system test cases for problem A?

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

What a strange contest. D1 and D2 combined were worth 1750, but most people think that D was easier than B and C. Surely the contest writers knew that 5 ad hoc problems is quite unusual.

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

Such a disgusting round. Nothing to learn, no use of dsa/algo, unclear statements, weak pretests, poor choice of problems, misleading score distribution, __

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

Stop writing CF rounds!. :)

»
6 лет назад, скрыть # |
Rev. 5  
Проголосовать: нравится +20 Проголосовать: не нравится
A
B
C
D
E
  • »
    »
    6 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    for D,

    look at sample cases and do exactly.
    take two pointers i and j
    initialize i = 0, j = (n / 2)
    now alternatively add them to another vector.
    check answer count.
    print it.
    AC.
    
    • »
      »
      »
      6 лет назад, скрыть # ^ |
      Rev. 2  
      Проголосовать: нравится 0 Проголосовать: не нравится

      For D2

      Sort the input and split into 2 parts — low with N/2 elements and high with (N+1)/2 elements. Put to the answer the first element from high. In a cycle try to put the element from low followed by the element from high (put it if it's smaller than the previous element in the answer), otherwise put one element from the high. Once you have no elements in one of the parts, break the cycle and dump the rest to the answer.

      93231855

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

I failed at D2 and I don't know why? Can you check my code?

93223419

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

I failed at D2 and don't know why. Can you check my code?

93223419

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

Nice round awesome pretests

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

weak pretest

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

While I pretty much agree with complains about the problems

I just don't see what was so difficult about the definition of "nice staircases" everybody mention

"A staircase with n stairs is called nice, if it may be covered by n disjoint squares"

Just what can be misunderstood here?

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

    Misunderstandable are: How much stairs a staircase has? What counts as a square? What exactly is meant by disjoint?

    Of course, once understood what the writer intended to say it is clear.

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

      "If a staircase has n stairs, then it is made of n columns, the first column is 1 cell high, the second column is 2 cells high, …, the n-th column if n cells high"

      Extremely clear

      It is probably possible to argue about the definitions of a square and disjoint. But I just don't see how else the problem can be interpreted.

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

        Well, in this case I did not misunderstand the statement at some important detail or the like. I simply did not understand it at all.

        The main detail I missed was that the number of stairs is the number of cells in the diagonal in the surrounding square. Because of this I was not aware that the number of squares (the colored ones in the picture) is equal to the number of stairs.

        Reasons for not getting the idea was maybe the usage of the words stairs and staircase, which where pretty meaningless to me, just two similar sounding words. In that case a somewhat more formal defintion would have helped.

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

In problem B the colors of squares of sample was showing the solution.

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

Am I the only one who solved D2 like D1

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

Currently I am the only one who failed test case 16 on C FST!

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

bad contest With weak pretests

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

This is the first time I have solved 5 questions in div2. Because I was ill today and had a bad cold and fever, I thought about it and decided to register a new id to participate in div2 tonight to avoid losing rating. But the result of this is that my main id lost an opportunity to record a memorable milestone. (My main id used to solve 5 problems on codeforces, but that was in div3). God knows when I will solve 5 problems on div2 next time. (If you know my main id, don't say it, thank you.) I hope I can have good luck next time, and good luck to everyone.

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

    I disagree with ur idea of giving contest with a new account. I think if you perform bad in any contest then you would easily regain in the future rounds. Just to have a better graph of rating should not be a reason to make new account.

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

    I think you deserved it, there is no reason for anyone to have an alt account in my opinion, let this be a lesson and try to overcome your fear of contest and rating changes.

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

so many system test failed ...

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

Really thankful for the first test case of problem C. I think many would have got wrong answer, if this case was not in the sample test case.

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

Weak Pretest for A & D2. :)

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

What if the problem F is easier than now?

The number of solutions for E is much more than that for F although the number of solutions for D if far much more than that for E.

Maybe make D more difficult and make F easier will provide a better experience.

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

I suppose there is something I haven't got about how contests work. I saw a green "tests passed" in problem D2 during the contest and now I see an error in test 67... How can it be?

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

E is an old USAMO (a math contest) problem

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

I didn't submit D2. But my D1 solution was the D2 solution too.

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

Weak pretest in problem A and D2.Same problem again and again...

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

Useless nasty pretests in A & D2.

They decided just not to cover the last testcase of D2 in pretests which could've made a difference for many people.

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

I hope the statements were clear and short

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

one of best contest ever :)

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

Hey @shishin,

I got flagged for copying with some random guy I have never heard of in my life for Div 2 C. I think it may be because of the brevity of my code:

for _ in range(int(input())):
    n,x = map(int,input().split())
    l = list(map(int,input().split()))
    if all(i == x for i in l):
        print(0)
    elif sum(l) == n*x or x in l:
        print(1)
    else:
        print(2) 

Can I please get unflagged? (I was using a private IDE as well btw)

Thanks.

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

Finally become purple thanks for the contest

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

I suppose the difficulty of each question in the contest is similar to the picture below.

I think most participants think the problem A and D2 are a little annoying because they are easy to FST.

Wish that all the participants can FST less!

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

May I ask a (maybe naive) question?

Users like dzh_loves_mjy whose rating is less than 2099 are not rated. Why is it?

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

Just for fun :

Problem A.

my hack was last hack during contest (test 83 last test of systests).

Spoiler

and (> 50) solutions fail on that test in systests.

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

Hi, Iam practising from a long time on codechef and hackerrank but iam not able to solve problems what should I do.??

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

    Just try to get out of your comfort zone and try solving problems that you are unable to do in the first go. Think hard on such problems. Do this for a few days. Apart from that try virtual contests as well.

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

Can anyone explain me what to do in Problem A? Its really confusing for me :(.

It says Raze can mark digits from odd positions and Breach can mark digits from even positions. Find who cant cross the last digit if Raze starts. Can anyone explain what am i missing. Thanks!

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

    Raze and Breach mark digits in odd and even positions respectively. They stop when there is only one left. The question is to find whether this last unmarked digit is even(Breach wins) or odd(raze wins).Since both players play optimally, suppose there are more digits on odd places (Raze has high ground) and there is an odd digit in one of those places, he marks the rest of the digits and the odd digit is left and he wins.

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

Bad round

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

Why so less upvotes ?

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

Me before the contest: Jokes over, you're dead Me after the contest: Need healing, Jett revive me Jett