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

Автор SlavicG, 22 месяца назад, По-английски

Hello Codeforces!

mesanu, flamestorm, MikeMirzayanov and I want to invite you to Codeforces Round 799 (Div. 4)! It starts on Jun/14/2022 17:35 (Moscow time).

The format of the event will be identical to Div. 3 rounds:

  • 5-8 tasks;
  • ICPC rules with a penalty of 10 minutes for an incorrect submission;
  • 12-hour phase of open hacks after the end of the round (hacks do not give additional points)
  • after the end of the open hacking phase, all solutions will be tested on the updated set of tests, and the ratings recalculated
  • by default, only "trusted" participants are shown in the results table (but the rating will be recalculated for all with initial ratings less than 1400 or you are an unrated participant/newcomer).

We urge participants whose rating is 1400+ not to register new accounts for the purpose of narcissism but to take part unofficially. Please do not spoil the contest for the official participants.

Only trusted participants of the fourth division will be included in the official standings table. This is a forced measure for combating unsporting behavior. To qualify as a trusted participant of the fourth division, you must:

  • take part in at least five rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1400 or higher in the rating.

Regardless of whether you are a trusted participant of the fourth division or not, if your rating is less than 1400 (or you are a newcomer/unrated), then the round will be rated for you.

Many thanks to the testers: Neophiliatic, Qualified, sandry24, _Anurag, jampm, TimDee, Olympia, hbarp, AlperenT, BucketPotato and VIP-tester _Vanilla_.

And thanks to NEAR for supporting this round, details can be found in this post.

We suggest reading all of the problems and hope you will find them interesting!

Good Luck!

UPD: Editorial is posted!

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

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

As the tester I want to say

orz orz orz big great SlavicG thank you for dib4 div 4 div orz

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

I wait it

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

Good luck for Everyone

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

As a tester, get SlavicG to top 10 contributors by upvoting all of his blogs.

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

As a VIP-Tester, I can guarantee that nobody's life was endangered prior to me getting this role.

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

    As a tester, I can guarantee that vanilla is beneficial for health.

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

      As a VIP-Tester, I can guarantee that eating vanilla icecream will give you positive delta.

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

I love div.4 rounds. Good luck for everyone who less than 1400**!

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

Good luck for everyone

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

Thankyou to all the testers and problem setters, and good luck to everyone

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

Another Div-4 Round, thank you! I love these kind of problems!

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

Good luck in lightspeedforces round

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

If anyone knows the real name of Lemon Sunomono tell pls.

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

Last 2-3 contests were so difficult, I hope I do good in this one and get back to green.

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

I look forward to give my first contest in Java, which I learned recently :)

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

my first contest me as a unrated participant :)

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

This is my first contest as an unrated participant...Good luck everyone!!

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

Prepare for the memes about specialists being unrated :/

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

Thank you sir for organizing div 4 contest.I always love div 4 problems.I think all beginners also love div 4 problems.

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

If someone is currently Specialist and is going to become Pupil after the end of Educational Round 130, should they register now and be *out of competetion, or wait for delta change and then register in competetion ?

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

    wait for delta change and then register in competition, because maybe you'll get positive delta in this round.

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

First unrated round for me, feels good!

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

What happens if someone is pupil and becomes specialist in the previous round but registers for this round as a pupil, will the contest be rated for them?

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

GOOD LUCK EVERYONE:) HOPE I'll able to solve 2+ problem in this contest;)

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

If I cannot make to specialist tomorrow, I will shave my head.

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

First unrated contest for me.

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

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

My first unrate contest OwO

P.S. Good luck for everyone.

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

    I'll be a specialist, when they will give a rating for Educational Codeforces Round 130 (Rated for Div. 2)

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

      You sure? System testing for that round isn't done yet and your solution for C is O(n^2) imo, so your solution might TLE. P.S.- I hope you pass though :)

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

I wanted to add VIP tester _Vanilla_ as a friend, but he is currently a friend of 69 users.... so I'll let it be for now

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

    Wise decision, breaking such balance would bring chaos upon our universe.

    UPD: It seems like someone has already done it. The legend says he will have negative delta for the rest of his life.

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

Good luck everyone , hope this would be a fun and interesting round to be participated in.

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

leetcode monthly contest?

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

![ ](IMG-20220613-223340)

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

My first unrated round :)

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

first contest as an unrated participant

GOOD LUCK TO EVERYONE!

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

"take part in at least five rated rounds (and solve at least one problem in each of them)"

Is it some new feature? I can't remember the same thing being about a year before. Especially because my rating has been changing since my first rated contest.

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

What are the hacks? What can participants do? Sorry, maybe dumb question, but I am first time here

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

As a tester, I can assure you this is going to be one of the best div4 round till now, congrats to the problem-setters for the great problems, and I wish yall good luck!

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

Will Try to Finish it under 40 min. Previous record is 50 min. Let's see if we can break it Today!!

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

    Well seems like it wasn't speed forces after all.

    I really loved problem H.

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

      Yeah i came late and got stuck on H because i am a retard clown whose always do the silly mistake everytime. i liked problem H i have solved this type of problems before a lot. So for me i was doing nothing new as implementing what i implemented before.

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

Does anyone have a problem with the dollar sign in problem page all brackets sees like $ sign.

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

Hope every want to be Specialist can be Specialist.

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

Difficulty:

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

Once again, if you are not sure, I will say as tester — this round is really fire, it's one of the best quality rounds of last months, and best div4 I ever took part in. I suggest everyone reading all problems (even Blue-Purple-Yellow-Red participants). Good luck and have fun writing this contest.

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

First unrated :D

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

hopefully, I will motivate again for this contest. thank you for arranging div4 for the newbie

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

Downvoted. DIV4 SHOULD DISAPPEAR!

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

2 hours 15 minutes sounds like a slightly harder round... interesting.

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

    Just for my curiosity, was it really harder in your opinion? When I tested problem H seemed very respectable :D

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

      Yeah, feels like H was around 1600-1700 rated in terms of implementation and apart from that I really liked how creative D and F problem were.

      This time it was a different Div. 4 round :)

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

Can I register lately?

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

Rip cfsubmit didn't work properly for me when submitting to problem C, costing me 4th place :(

Nevertheless, I clutched 6th place with a meme screencast: https://www.youtube.com/watch?v=Aw_U6cnUh-0&ab_channel=JoshuaChen

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

Very educational contest! This is the type of Div 4s that enjoy participating in.

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

the last problem is very nice, kudos to the author

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

Nice H..

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

Nice contest! For those who are interested, my screencast and solution explanations to all problems will be available at https://www.youtube.com/secondthread as soon as the contest is over.

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

nice round, F is interesting

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

Enjoyed the round. Thanks to the problem authors! :)

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

Awesome contest, Nice set of problems !! Thanks to the authors <3

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

I choked F lol. I missed $$$7 + 7 + 9$$$. Cost me 3 penalties...

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

H was nice

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

I was trying to solve the E problem with 2 pointers by making an array of indices where there are 1's and calculating the difference and moving accordingly. Was I correct ??

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

can someone tell me what am i doing wrong here for question F

https://codeforces.com/contest/1692/submission/160638148

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

    First, explain your logic, and then I'll check it.

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

      sorry for downvoting its pressed by mistake

      here I first make frequency array of remainder than I go to each case such that on adding it gives either 3 or 13 or 23 than i check if it is possible by checking their frequencies

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

        The approach is right,just move case(x==y && y==z) to the first place because it will never execute when x=y or y=z or x=z;

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

I believe that this was the perfect div. 4 round! Problems were educational and of perfect difficulty.

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

I get 4000-5000 ranks in div2 and 12000 in div4 feels like hell:°(

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

Can someone please tell me what's wrong with my two pointers solution for problem E? 160627514

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

    Explain your logic and variable names first, and then I'll check it.

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

      thanks bro. "i" stands for pointers from the begin, and "j" for the end. Bufa is the number of 0 from the begin while bufb is from the end. The two pointers would increment 1 generally. In the meantime, one would check wether the other pointer can get a 1 with lower 0 counts.

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

loved problem F. not because of the problem, but because of the name ;)

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

cf definitely hates me, just because i put 3 instead of 4 got WA on test 1 (the WA on 8 was because of l)

i would've got specialist :/

first and last code compared
  • »
    »
    22 месяца назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    bro if your code will fail test cases then you will only get WA nothing like hates or something.

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

Congratulations to authors for problem H!Very interesting!

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

What is wrong about my code of Problem C

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

    if(ans[i][j]='#'), should be ==. You can even remove that if.

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

why map gave tle in b?

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

    If the size of map is n,each times,the time of useing map[i] is log(n). I see your code,even the map[i] is 0,u search it.This need log(n) to modify the map and log(n) to query. I advise u to use for(auto it:'map's name') to query each in map.That will avoid insert and modify the map[i] that == 0. What's more u only need to know the number of the kind.So set would be a better choice. The ans is the size of the set.And if (n — ans) is odd,u have to ans--,since u can only remove two numbers each op. Here is my submission that use set to slove:160536879

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

Hello people,

I couldn't figure out what's wrong with my code for problem C. I would appreciate any guidance,help, answer or hint in order for me to correct it.

https://codeforces.com/contest/1692/submission/160649178

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

    I think that the input() in python also reads blank lines, so when you try to iterate from 0 to 7 produces runtime error. Also in your answer you don't put an space between str(outputs[k][0]) and str(outputs[k][1]). But the logic is perfect, it's simpler than what I did.

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

      Hello, thank you for your response

      I just update my code according to my understanding of your idea added another input line for blank line (it has been said that input cases should be seperated by a blank line) but I'm still having the same issue. Could you propose an adjustment to it please.

      https://codeforces.com/contest/1692/submission/160663411

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

        In the case of:

        3 <- num of test cases
         <- empty line
        ..#...#. <- line with 8 characters
        

        The program will fail in the second line, because when you do array_elements = [array_elements[i] for i in range(0,8)] you will have an out-of-bounds error, because len(array_elements) is zero.

        So we want to ignore empty lines, no matter the position, for this I simply add a while loop:

        array_elements = "" # empty string
        while len(array_elements) == 0:
            array_elements = input()
        

        I don't believe this is the adecuate method because I don't program in python, but it solves you error

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

I tried to hack a submission of H, but the judge returned 'Unexpected verdict'. is it my hack's failure ? or judge's?

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

There are some Unexpected verdict in the Hacks of problem H.

This blog said that it's because one of the solutions marked on Polygon as Correct can't pass the hack data.

Please fix the problem.

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

I'm curious why it's rated for everyone rated less than 1400 whether or not they are a trusted partipant? Someone rated >= 1400 can create a new account just before the contest and ruin the ratings of Trusted participants right? SlavicG mesanu flamestorm MikeMirzayanov

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

    No. The contest is rated for everyone less than 1400 but only official participants are considered while deciding the actual delta. So new accounts won't have any effect

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

      Then how will the delta for non-trusted participants be calculated?

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

        If I'm not wrong, all new accounts have a 1400 hidden rating at the start. For the first 5 or 6 rounds, you are gaining additional rating points which sum is equal to 1400 (that's why you can solve 0 problems but receive something like 357rating) + normal rating delta for the account that started with 1400 points.

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

Problem H was a nightmare for unordered map users. Also idk why a lot of python users are getting hacked in this problem.

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

Amazing round, my first time solving all problems,even though the last one only after the contest. Great feeling!!

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

What is the case of 73 of test 2? Not accepted, someone help me please. 160678922

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

Understood the method, found out about Kadane's algorithm!

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

Can anyone please point out the error in my code/logic (Problem G). I used a sliding window approach by making a window of size k. The variable bad used in my code tells the last index till the current index where the inequality does not hold.

My submission
https://codeforces.com/contest/1692/submission/160622089

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

    You can try this case:

    1
    10 3
    1000 20 10 5 9 10 11 12 13 14
    

    Answer is 4 but your solution output 6.

    I found that you will break after finding the bad position for the first time, which causes if there are multiple bads in the length of k, you will only find the first one

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

    Now I changed your code :

        f(i, 1, temp.size())
        {
            if (2 * temp[i] <= (temp[i - 1]))
            {
                poss = false;
                bad = i;
                //break;
            }
        }
    

    And Accept 160742816.

    It's a good idea, just didn't notice the details

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

Is there any indication of whether the regrade has happened yet?

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

I think this is the longest time I waited for rating change

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

    are you expecting a colour change?

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

      Intially I expected that I'll be Cyan for my rank and number of participants but realised It doesn't happen in Div4 and now you are seeding doubt for even green colour change

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

        even I am waiting for my color change. But now it seems like this competition was maybe unrated. IDK though

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

...

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

Is it possible that a person less rated than other one and has got more rank in the contest than the other one, after rating change become more rated than other one??

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

    Yes, if that contest of more ranked participant is still less than or equal to 6