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

Автор Nezzar, история, 3 года назад, По-английски

Good morning/afternoon/evening, Codeforcers!

We (Nezzar, triple__a, Nanako) are very excited to present to you Codeforces Round 698 (Div. 1) and Codeforces Round 698 (Div. 2), which will take place in Jan/28/2021 17:35 (Moscow time).

There will be 6 tasks waiting for you to be solved in 135 minutes!

We would also want to thank:

Score distribution will be announced at $$$n$$$ $$$(0 \leq n < + \infty)$$$ minutes before round starts.

We hope you high performance with a lot of points earned during contest!

UPD1 $$$n$$$ is chosen to be $$$300$$$.

Score distribution is

Div. 2: 500-1000-1500-1500-2000-2500

Div. 1: 500-1000-1500-2250-2750-4000

UPD2 The contest is ended despite CodeForces under attack from DDoS midway. Thanks all for joining!

Here is the editorial: Editorial

UPD3

Congratulations to the winners!

Div 1:

  1. maroonrk
  2. panole
  3. tourist
  4. Rewinding
  5. boboniu (The only contestant who solved F during contest time!)

div 2:

  1. bahu
  2. yplane
  3. islingr
  4. chen__zexing
  5. ChuTian

People who were first to solve each task:

D2A: pj423

D2B: Zeyush

D2C: BelieveInYou

D2D/D1A: IgorI

D2E/D1B: SSRS_

D2F/D1C: Benq

D1D: Um_nik

D1E: tourist

D1F: boboniu

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

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

As an author...

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

As a 17:35 msk hater...

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

missing almost-copy-pasted-part lmao

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

Setters and testers from Hong Kong :o

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

My first round after a long pause. Wish all participants good luck and easy problems

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

Hope it remains rated.

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

Um contest tab shows 120 minutes but you said 135 minutes?

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

    Nice catch! The one in contest tab will be changed to 135 minutes.

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

      Please give me 100 points for successful hacking attempt in this round. Thanks.

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

How much delay this time?

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

A question regarding the constraints of n:

Shouldn't it be $$$(0 \leq n < + \infty)$$$ instead of $$$(0 \leq n \leq + \infty)$$$?

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

    Sure thing

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

    We can actually make the constraints better. Since we will anyways get the scoring distribution after this certain point of time the range of $$$n$$$ can be better written as $$$0 \le n \le f$$$ where $$$f$$$ is a finite number which I don't have the finiteness to calculate.(but it is finite).

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

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

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

As a Japanese participant, I was amazed that there is another p*0523 near Japanese testers in the post...!

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

It's comforting to know that $$$n \ge 0$$$.

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

Thanks for the contest Nezzar, I am a beginner and I managed to solved three questions in the previous contest, really hyped, looking forward to this one too... Love you codeforces Family!!!

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

Long time no see (div1)

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

finally div1! ^_^

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

As a tester...
Hope this round will go smoothly!

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

I have noticed that there are no weekend contests?

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

Thank you triple__a, Nezzar and Nanako for preparing div.1 and div.2 contests.

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

Just going to say that I'm a huge fan of starting round announcements with a "Good Morning!"

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

As a co-author...

Maybe I don't really deserve this appellation... I think I'm more like a tester because triple_a and Nezzar come up with many ideas with great inspiration when I just come up with much less ideas (and finally none of mine is interesting enough to become a problem in this round lul).

triple_a and Nezzar is really respectable. They spend half a year preparing this round. Comparing with them, I think I just do something that's not worth much mentioning.

Hope you can have fun in this round!

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

    I am sure all of you work very hard and prepare such contests. Thank you for all the efforts you put!

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

    I can understand you. Different coordinators have different review standards. Some coordinators are very strict, and they have a very low pass rate for the questions they review. This does not mean that your topic is not interesting enough, maybe it is just that the level of interestingness does not meet the standards of this coordinator. Different coordinators have different definitions of interesting, so your topic does not seem interesting enough for this coordinator, but another coordinator (possibly) will find your topic interesting. Then, even if your topic is not selected, I think your contribution is enough to make us thank you. Looking forward to solving the problem of your proposition, although my level is not high, I will try my best.(One more thing to say, if your dream is to be an excellent writer, don't be disappointed in yourself. I believe that one day, you can impress the coordinator with your interesting topic.)

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

    Thankyou for the contest :)

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

n can be equal to 0 as well, then scoring distribution may be known only when the contest starts? :(

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

It would be interesting if n <= -135

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

Another China round! Thank you very much for the selfless dedication of the authors and testers, so that we can have a different experience. Then, let me guess, after this round, another China round is coming soon? (maybe the global round)? Let me look forward to it^__^

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

As a tester, hopefully you also find the problems are interesting like I do! I enjoy testing the problem set even I test it after tiring work. Good luck all!

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

Why can't users with a $$$1900 \leq rating < 2100$$$ register for the Div. 2?

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

Codeforces Declares round unrated due to long queues.

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

Notice the unusual solving time (135 mins).

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

Finally a div1 round!

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

could've easily had a tighter bound for n(the total no. of mins before the round starts)

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

Oh well...

17:35(UTC)=22:35(UTC+8)=less sleep

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

    Since when $$$17.35 \text{ (UTC)} = 22.35 \text{ (UTC+8)}$$$ :( ? Did you mean $$$17.35 \textbf{ (MSK)}$$$?

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

My question is in this solution 105544722 return me answer please

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

135 minutes! It is interesting.

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

надеюсь рейтинг)

»
3 года назад, # |
  Проголосовать: нравится +56 Проголосовать: не нравится
queue<long> q;

Long queue or something IDK, but I hope it does not happen :D

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

Score distribution will be announced at n (0 ≤ n < +∞) minutes before round starts.

Does this mean it is possible it will not be included in blog before contest, rather we will be seeing the distribution in contest?

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

Well DIv2 D = DIv1 A with this score distribution right!

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

Nezzar Please remove "!" from 300, it seems like you want to say 300 factorial :(

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

I suggest holding a testing contest before today's contest to test the In queue, MikeMirzayanov!

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

$$$4000$$$ points for Div.1 F...That's gonna be tough.

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

    they said that it took half-year preparing it so they had put a lot of effort to make it. so I think why problem F gives 4000 points and I think div2 will have a subproblem.

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

    u r right

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

I hope I can solve problem D in this contest.

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

Good luck!

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

Interesting score distribution for Problem C and D.. :)

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

Fortunately the wait for div1 + div2 is over

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

oh!Good luck!

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

Hoping a good contest today without any queue issues :)

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

contest getting delayed in 1....

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

This is the joke about the hard contest you are looking for

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

I am facing queue issues on Problem B

Is there someone else also ?

Edit: Resolved

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

YES_NO-forces :D

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

Whoever came up with the problems really overestimates the CF community.

Jokes aside, a tough one for sure.

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

Hello Community. I want to ask one question. I submitted B problem twice, both passed pretests. Which one will be considered ? My rank went from 2200 to 4400 . Please somebody tell me .

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

Very nice problem set... thank you authors

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

Can someone help me with the 2nd one after the contest?

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

How to solve C?

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

    suppose n = 3 , then suppose array a will be of form $$$a_1<a_2<a_3$$$ and their negative values also . Then array d in increasing order will be (note that every number in d will be repeated twice so we are only considering n numbers) say $$$d_1<d_2<d_3$$$ then $$$2*(a_1+a_2+a_3) = d_1$$$ , $$$4*a_2 + 2*a_3 = d_2$$$ , $$$6*a_3 = d_3$$$ .You can show this by using formula in question. Now you can find $$$a_3,a_2,a_1$$$ one after the other using the equations .

    Similar generalization for any n.

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

i probably overkilled C, but was there a reason for why the numbers were distinct? it cost me a WA coz I didn't think they should be, probably why my solution was hard.

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

A big big dislike for Div2 C and D. Both are more christmas riddles than programming problems. I do not care any more for orginal ideas or the like. For me this kind of riddles are only boring. You need to find some wired observation, like walking blind in a labyrinth finding the exit.

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

    totally agree, id rather have repetitive algorithmic problems than these find the pattern after 100 examples problems.

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

    Ya I don't know who likes these problems if most of them diskikes this type of problems then these puzzles are made for whom a big question mark on the community?

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

      I like them, and I know some others who do. More math-minded people I think tend to enjoy them

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

    It is not atcoder no!

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

    I think div2D/1A was a great problem. It was refreshing to see Bezout's Theorem, and it was a cute observation.

    Div 1B on the other hand was just standard lazy seg-tree so that wasn't so exciting but it was cool still.

    How to solve Div1C?

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

      If such things are cute for you ;)

      I liked the segment tree, the update operation was not very intuitive for me, I think I never implemented that kind of update before.

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

    I don't have any ideas about D, but I think the observation for C was not hard to stumble upon. I would say C was more intuitive and easier for me than B.

    Basically, take some small arrays, then try writing the sum of absolute difference for them, the way it's defined — but don't calculate the value, instead just observe the terms themselves in the sum of absolute difference.

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

      Yes, and some hundred participants did like this. Some other thousends did not. So where is the point?

      It was easy for you, so it is a good problem?

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

        It was hard for you, so is it a bad problem?

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

        I think if one were to try out small arrays and try to observe from them, the observation itself is not a very obscure pattern.

        But yes, I get your point. I am not saying it was a great problem — but was one of the better problems compared to other Div2 contests these days.

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

    For C i solved by using the definition of how array d is constructed (by getting n equations).So it wasn't puzzle for sure.

    In D i observed (don't know if correct) that we require at most 2 numbers to create k .

    In B , i had idea that after a point all numbers can be created by lucky numbers but was not able prove it and didn't solved it.

    So i can't say anything regarding D and B.

    Let's hope tomorrows Educational round will be a good one.

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

    I disagree with you . They were really beautiful problem with some really good observation . I couldn't solve D but you can see my solution to C which is I think really clean and nice .

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

    These day if you want to get good in codeforces contest then it appears practicing puzzles is more beneficial than studying algorithms to

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

    agreed. Solving C was not at all fun. it was just some boring observations.

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

    Well, here is how you could navigate a labyrinth even blind without any weird observations or luck: click

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

How to solve B and in problem D do we needed to check if k can be formed by any two numbers in array ?

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

    for problem B, you can use lucky number multiple times. means for d= 7, ai = 52, 7+7+7+7+7+17 is allowed answer

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

      You can compute all lucky smaller than d * 10. If the current number is >= d * 10, print "Yes. Else if it is among the previously calculated numbers print "YES". Else print "NO"

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

    In problem B, we need to observe that for every number greater than 10*d, it is always possible to get the sum, for number < 10*d we can brute force and check.

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

      and that observation I made by running a dp solution up to some small numbers for each digit. I saw that beyond 10*d everything was possible. I could not prove this and continued with this observation.

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

        the simple proof of this is lets say a number is >= 10 * d then 10 * d would be of form "d0" then the remaining n % d part can be added to this number and still you have a digit 'd' on the tens place.

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

how to do D?

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

Can someone please give a test-case for which my code fails for problem C? WA_CODE

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

Any hints for D?

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

    You can view the operation as taking a number in the array and adding the difference (with your choice of sign) between any two other numbers of the array to it. Note that you can repeat the operation as many times as you want.

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

    Assume we have set $$$(a_{1}, \dots a_{n})$$$ and $$$g=gcd(a_{2}-a_{1}, \dots , a_{n}-a_{n-1})$$$. Then the closure of operation $$$2x-y$$$ is set $$$(\dots a_{1}-g, a_{1}, a_{1}+g, a_{1}+2g, \dots)$$$.

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

      Could you explain what is closure, seems interesting!!!

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

        Assume we have a set $$$S$$$ and operation "bring some numbers $$$a, b, \dots$$$, and insert into $$$S$$$ some value $$$f(a, b, \dots)$$$". Let do operation while we can get number, which is not in $$$S$$$. The set we got is called closure of set above operation (I am not sure if I wrote it correctly in english). It is just definition.

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

So Div1B/Div2E isn't segment tree or what?

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

    I solved it using segment tree, don't know if there's an easier solution

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

    Yes, it was segtree with: "set all values in a range to $$$x$$$ " and "find sum of a range".

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

    Yes, you consider the queries in reverse order, and then note that the starting string is uniquely determined by the conditions (if at a point you have exactly half the elements in a range to be 0 and the other half to be 1, then this is invalid, and the answer is NO, otherwise you can just set the whole range to the majority element of the range). If the array so found is the same as the given initial array, then the answer is YES, else it's NO.

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

      Exactly did this but probably there is sum bug in my code :(

      not exactly, After doing this i tried to change the array so that is the wrong logic :(

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

        I personally did a sum-query for each element (in the form [l, r] = [i, i]) to retrieve the new array using these operations, so this might be useful if you can afford to take $$$O(n \log n)$$$ time for creating the final array.

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

    both segment tree and chtholly tree is ok

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

Is there anyone who also got WA on pretest 7 in Problem C.

Very disappointing problem c :(

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

    Assuming we did the same thing, i.e. creating the sorted positive half of array a, I was getting it when I was checking if the array is non-decreasing, it was resolved when I checked the array to be strictly increasing.

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

In div 2D, If we can form any two consecutive numbers, we can form any number. Was this observation helpful?

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

    Very close, but no. The observation that works is that if you take the difference of all elements with the first element, and call the resulting array $$$b_1, \dots, b_{n - 1}$$$, then performing the operation corresponds to finding the sum/difference of a few of these elements, and you can find an operation where it corresponds to finding the sum/difference of any two elements of $$$b_i$$$. Hence, the gcd of all $$$b_i$$$'s is achievable, and this is necessary and sufficient.

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

    deleted

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

    We are really sorry that D1C has been appeared before. None of the team know the existence of this problem and we come up the whole problem ourselves (the idea comes from the lore actually)

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

      it's ok , i am not blaming you, i know it;s impossible to remember all the problems

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

When you use double to get the distance of two points with fuction sqrt in div.1C:

qaq

upd: WHY IT CAN PASS THE SYSTEM TEST? Too weak tests >_<

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

As a low-ranking coder in this round, I hope I can get some upvotes.

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

F looks beautiful, but I have no idea how to solve it :<. After solving some differential equation I managed to understand first sample, but that doesn't generalize at all to almost any other inputs xd

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

    This paper explains how to count the probability that the maximum part is <=k after picking n random points. Then we need to put those probabilities into an exponential generating function, it turns out to be a sum of O(len) terms of form koef*exp(alpha*x)*x^beta for alpha of form i/total_length and beta up to total_length, so there are O(total_length^2) possible terms up to koef. Then we need to multiply all those generating functions, which boboniu does in O(total_length^3) by just using the fact that each of the functions has only O(len) nonzero terms so we can multiply naively, but maybe some FFT was required? The system test will tell :)

    Getting all details right within the contest is insane, hats off to boboniu!

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

      The editorial says that we actually have only O(n*total_length) nonzero terms in the product, therefore the naive multiplication is O(n*total_length^2) which should be good.

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

Such an awful and terrible and unfair contest

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

    Why? Was there some issue in Div 2?

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

    I do not see how it was unfair.

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

    Having more math elements in a contest isn't unfair to anyone. As long as the everybody can login at the same time, and the problems are correct, there is never an unfair contest. There may be "unbalanced" contest sometimes, but not this one. It isn't the author's fault if the problems had troubled you.

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

Chinese contests are even more faulty than Chinese goods.

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

For everyone who got WA on test 2, Div1B/Div2E, try this case:

2 1

11

10

1 2

The correct output is "NO", and if your output is "YES", you probably forgot that strictly less than half of the interval can be changed (at least that was my bug)

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

4/6 problems in div2(BCDE) just required me to output yes/no! I was grateful for not asking me to construct a way or something lol

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

Thanks for strong pretests for A and B....i loved to solve those....But couldn't even understand C

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

Please next time don't give us riddles like C or D, we all want programming problems!

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

After countless attempts and failing on B, losing 150 points and going down to 1500 from 1770 in just 2 contests, I've found a solution to the extended version of B.

So in case anybody is curious, suppose that the question also asked for example numbers, not just a "YES" or "NO".

We can see that number X * d, can be expressed as sum of X d's, in form:

d d d .... d (X times)

In other case, we can take a look at the number's last digit (say P) ans find the minimum multiple of d which corresponds to the same last digit. So suppose we have input:

113 7

The output should look like:

7 7 7 7 7 7 7 7 57

And how do we get this? Simply, if the multiple that corresponds to our last digit is equal to X * d, then we can take d and print it (X — 1) times and finally print S — (X — 1) * d, where S is the starting number.

The only case when it is impossible to print a valid sequence is when the lowest multiple with the same last digit is greater than our current number.

I hope some of you found this interesting, as it can be made into a solution to the easier version of the problem.

EDIT: And this goes to prove why 25 isn't possible, 53 isn't possible, 46 isn't possible, etc.

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

4 of the first 5 problems of Div2 were YES/NO problems. Maybe author's crush is very straightforward. Accpet or Reject his proposal in YES/NO

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

In div1 C, is the answer always possible?

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

As an

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

Welcome to MathForces

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

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

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

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

Who else got screwed in that contest? Though problem set was nice.

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

Thanks for contest! C was very nice to solve.

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

    Can you explain the idea? I tried reverse the array A, but it seems the wrong.

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

      I will give you an example to think about the idea. Let's say we have 3 distinct numbers (we will use the positive numbers since it is easier to reason about) [a, b, c] where a > b > c.

      Calculating the sum of differences for a:

        = (a - a) + (a - (-a)) + (a - b) + (a - (-b)) + (a - c) + (a - (-c))
        = 0 + 2a + a - b + a + b + a - c + a + c
        = 2a + 2a + 2a = 6a
      

      In general, with [a_1, ... , a_n], where a_1 > a_2 > .. > a_n, then sum of differences for a_1 is as follows:

        = 2a_1 + a_1 * (n-1) - (a_2 + a_3 + ... a+n) + a_1 * (n-1) + (a_2 + a_3 + ... a_n)
        = 2a_1 + a_1 *(n-1) + a_1 * (n-1)
        = 2 * n * a_1
      

      From this, you can find the value of a_1. Next, the way I thought about it was to consider [a_2, ..., a_n] (i.e. disregard a_1). But one thing is sum of differences for a_2 would be subtracted by 2a_1. This is because there is a term in the original sum of differences for a_2 (which includes a_1):

      (|a_2 - a_1| + a_2 + a_1) = a_1 - a_2 + a_2 + a_1 = 2a_1
      

      since we are disregarding a_1, we should subtract it by 2a_1.

      After subtracting, just do the same method as before to find a_2, then just do it until a_n.

      Hope this helps bro. Took me awhile to figure out.

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

I'd like to ask

After I had passed the questions in the contest

Again, I submit the approved code for this topic

Why is the second pass time calculated

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

105770938 In B, why I am getting wrong at test case 2 ?

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

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

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

it seems they didn't put the most basic case on problem C 1 1 0 0

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

In the problem Div2(B), What was the case for which most of the submissions got Wrong Answer on Test Case 2 in 10021th Token??

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

No shade on the writers, the problems were very cool and clever. These kind of ad-hoc, constructive problems help with developing quick thinking and problem solving skills. And they are great in a contest as long as there's diversification in the problems. Or atleast 2 out of 5 contests focus on DSA skills too.

Majority of participants are here to improve their DS&A skills (by majority I mean people who don't have high ratings and aren't seasoned programmers). I would love to solve some questions on tree algorithms, dp, binary search, dsu or any basic/advanced algorithm once in a while to develop those skills too. I understand this might not be the priority for some participants, but this would help us keep in touch with actual data structures and algorithms.

Here is a blog (Changes in Codeforces problem style over 2020) where this issue is very well put.

PS — Using an alternate ID. Please read before downvoting. Thanks

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

    Okay, let me repeat.

    1) If you want to solve standard problems on tree/dp/dsu/e. t.c, then you can find it in any archive, you do not need to solve it during a real contest if you want to practice this topics.

    2) If you want to solve a non-standard problem using any algorithm at a contest, this is fine, but

    2.1) Such problems are almost always more difficult than Div2D, because otherwise required algorithm is much harder than problem itself

    2.2) it is very difficult to come up with a high-quality problem on a well-known topic (atleast for me :D)

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

if my code wasn't optimized enough to pass the system test why did it pass pretests? Come on Codeforces, what's the problem??

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

To not keep you waiting, the ratings updated preliminarily. In a few hours, I will remove cheaters and update the ratings again!

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

https://codeforces.com/contest/1478/submission/105734232

Nice way to escape from MOSS. Putting useless for loops!

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

Check out my explanation of problem C — solution

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

what is 10013th testcase in B??

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

can someone point out the error in my code for div2-C

include <bits/stdc++.h>

include

define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

define ll long long

define endl "\n"

define lb lower_bound

define ub upper_bound

define fo(i,a,b) for(i=a;i<b;i++)

define all(v) (v).begin(),(v).end()

define all1(v) (v).begin()+1,(v).end()

define sort0(v) sort(all(v))

define max3(a,b,c) max(max((a),(b)),(c))

define max4(a,b,c,d) max(max((a),(b)),max((c),(d)))

define min3(a,b,c) min(min((a),(b)),(c))

define min4(a,b,c,d) min(min((a),(b)),max((c),(d)))

define pb push_back

define ppb pop_back

define mp make_pair

define inf 9999999999999

const ll mod=1e9+7;

ll inv(ll i){if(i==1) return 1;return (mod-((mod/i)*inv(mod%i))%mod)%mod;}

ll gcd(ll a,ll b){ if (b==0) return a;return gcd(b,a%b);}

ll pwr(ll a, ll b) {a %= mod; ll res = 1;while (b > 0) {if (b & 1) res = res * a % mod; a = a * a % mod; b >>= 1;}return res;} using namespace std;

int main() { fio; long long t; cin>>t; while(t--){ ll n,res=0,i,sum=0,max=0; cin>>n;

    ll a[2*n];
    fo(i,0,2*n)
    {cin>>a[i];
    if(a[i]%2!=0 or a[i]==0)
    res=1;}
    if(res==1)
    cout<<"NO"<<endl;
    else
    {sort(a,a+2*n);
    if(a[2*n-2]!=a[2*n-1])
    cout<<"NO"<<endl;
    else
    {fo(i,0,2*n-2)
    {
        if(a[i]!=a[i+1])
        {res=1;break;}
        if((a[i+2]-a[i])%2*(i/2+1)!=0 or a[i+2]==a[i])
        {res=1;break;}
        sum=sum+(a[i+2]-a[i])/(2*(i/2+1));
        /*cout<<sum<<" ";*/
        max=max+sum;
        i++;
    }
    /*cout<<max<<endl;*/
    if(res==1)
    cout<<"NO"<<endl;
    else
    {  if((a[0]-2*max)%(2*n)==0 and(a[0]-2*max>0))
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl;
    }}}
}

return 0;

}

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

Some tags

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

105785851 Why does this brute force sol work for div2 B? Shouldn't this get TLE?

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

    I think the constraint of number of test cases is saving the sol from getting TLE.

    1<=t<=9

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

.

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

Oh god I just realized that tourist must be in second or first place to win some rating. That's scary...

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

Can somebody tell me how they got their idea of solving B, I found B really non intuitive.

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

    I just think that d < 10 so no matter what d and a you are working with, just minus d from a will give you a number with the digit in the tens (hundreds, thousands,...) place is d.

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

Can anyone explain the intuition or solution to problem D?

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

In the problem c , I dont know whats the tc , it'll be very helpful if someone figure outs the error ,by the way , the error that is being displayed by judge is in tc 11 (which is obviously is not visible due to its length) The code is here

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

Love this contest <3

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

for D2F(D1C), it is quite easy, easier than D2D/D2E, why it is placed in the last problem, and get so much score? my solution is, firstly generate a random permutation as initialization, then brute force search an valid permutation based on this initialization permutation. the solution is very simple and source code is very short. if i know this i will definitly finish D2F earlier than D2D/D2E.