ScarletS's blog

By ScarletS, 5 years ago, In English

Hey there Codeforces!

flamestorm and I are glad to invite you to our first-ever Codeforces round, Codeforces Round 742 (Div. 2), which will be held on Sep/05/2021 17:35 (Moscow time). This round will be rated for participants with rating lower than 2100.

Special shoutouts to:

You will have 2 hours to work on (and solve!) 6 problems. At most one of the problems will be interactive. Make sure to read this blog and familiarize yourself with these types of problems before the round! You are highly encouraged to read all the problems ;).

UPD: The score distribution is 500 — 1000 — 1500 — 1750 — 2250 — 2750.

Good luck, and see you on the scoreboard!

UPD: Editorial is out!

UPD: Congrats to the winners!

Div. 2 (the only 5 contestants to solve the whole set!):

  1. shengtongtong

  2. zihouzhong

  3. NOOB228

  4. radiohead_fan

  5. TearsFreeze

Div. 1 + 2:

  1. SSRS_

  2. dlalswp25

  3. LayCurse

  4. neal

  5. Vercingetorix

We hope you enjoyed the round. See you soon!

  • Vote: I like it
  • +967
  • Vote: I do not like it

| Write comment?
»
5 years ago, hide # |
Rev. 3  
Vote: I like it +130 Vote: I do not like it

As a tester, I like the tags of this announcement just like the problems.

»
5 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

Really excited for this one!

»
5 years ago, hide # |
 
Vote: I like it +43 Vote: I do not like it

not because he contributed anything to the round, but because he would annoy me for months if I didn't mention him here
Lol

»
5 years ago, hide # |
 
Vote: I like it +50 Vote: I do not like it
»
5 years ago, hide # |
 
Vote: I like it -8 Vote: I do not like it

surang fan club rise up !

»
5 years ago, hide # |
 
Vote: I like it +104 Vote: I do not like it

ScarletS you had one job!

»
5 years ago, hide # |
 
Vote: I like it +24 Vote: I do not like it
»
5 years ago, hide # |
 
Vote: I like it +89 Vote: I do not like it

As a tester, did you know that if you don't upvote an 'as a tester' comment you will get negative delta? I have discovered a truly marvelous proof of this, which this margin is too narrow to contain.

»
5 years ago, hide # |
Rev. 2  
Vote: I like it +29 Vote: I do not like it

Me having to get up at 12:35 am (midnight) till 2:35 am because of bad time zone differences.

»
5 years ago, hide # |
 
Vote: I like it +27 Vote: I do not like it

I know that this will be a high quality round.

»
5 years ago, hide # |
Rev. 3  
Vote: I like it -6 Vote: I do not like it

upvoting this blog and giving me contribution Authors and testers always asking for contribution, reminds me of mr ditkovich from spiderman 2 who always used to ask for rent. https://youtu.be/usIJYbv_gXw

»
5 years ago, hide # |
 
Vote: I like it +27 Vote: I do not like it

Unban from server

»
5 years ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

By the way, who is saarang? @saarang

»
5 years ago, hide # |
 
Vote: I like it -15 Vote: I do not like it

Pupil missed the large range of testers. Sad life :(

»
5 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

time to upsolve this

»
5 years ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

As a participant, I hope this would be a great contest with 6/6 wonderful problems

»
5 years ago, hide # |
 
Vote: I like it -22 Vote: I do not like it
  • »
    »
    5 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it -14 Vote: I do not like it

    We all deserve low contribution because of the importance of

    this in the Codeforces community

    Don't you see that high-rated people have higher contribution? When your rating is high enough,people will start to give you likes. So dude,don't care about contribution. Care about how to get high rating.

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Good luck for everyone!

»
5 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

As a Newbie, I am gonna take ScarletS 's graph as a motivation

»
5 years ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

Has there ever been a tester that criticized a contest(before the round)?

»
5 years ago, hide # |
 
Vote: I like it +37 Vote: I do not like it

As a tester, I enjoyed being in the same team as ScarletS in hashcode this year!

He loves his team name

»
5 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

I will become Pupil after 3 days. This is so exhilarating...

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

As a participant, the day the contest starts is my 15th birthday, so I hope I could get a high ranking as my birthday present :)

»
5 years ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

Ready to become newbie again

»
5 years ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

支持此比赛!

»
5 years ago, hide # |
 
Vote: I like it -15 Vote: I do not like it

I have a question. I am a Chinese middle school student. But I started school on Monday morning, and I couldn’t participate in the Sunday night game. Because of the time difference, it only started after ten o'clock in the evening, and I needed to sleep. But what should I do if I want to participate in the competition?

»
5 years ago, hide # |
 
Vote: I like it +34 Vote: I do not like it

As the official video editorialist of the round, subscribe to my channel

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I really hope to solve problem C, but it might be too difficult

  • »
    »
    5 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    You are specialist and can't solve c ??

  • »
    »
    5 years ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    :)

    • »
      »
      »
      5 years ago, hide # ^ |
       
      Vote: I like it +11 Vote: I do not like it

      Sir kindly once have a look at it. These idiots are downvoting my contribution. My only intention was to stop such things and make Codeforces a healthy place in whatever way I can.


      I feel disheartened to see these things going around us and sharing with all of you what I came across recently. I was trying to solve this B problem and after devoting 1 hour approx I decided to log out my account as I didn't get it logic. I searched on the youtube the problem name just to check if anyone is not posting solutions during the contest like the way people post video solutions during codechef long challenges.

      It did not used to happen earlier but recently it started happen and I came this issue several times but I just moved on then. This time I could not resist myself from not sharing this, that these kind of folks are trying to ruin the whole environment of the community by doing such cheap acts just to get views and subscribers.

      Kindly take actions regarding the same. This needs to be stopped.

      Sharing the blog link and the youtube channel link. Please do have a look. https://techtogether.live/codeforces-round-742-mexor-mixup-solution/ https://www.youtube.com/watch?v=XlHgagQjUIc

      • »
        »
        »
        »
        5 years ago, hide # ^ |
         
        Vote: I like it +1 Vote: I do not like it

        Bro just chill, these peeps would go nowhere, and more importantly these peeps would majorly effect greens and lower blues... So, work hard go way beyond their ability and you are rocking and moreover many blogs have already been posted and many people at top level know about this and would definitely do something... Till then, just scratch your brain and enjoy!

»
5 years ago, hide # |
Rev. 2  
Vote: I like it -16 Vote: I do not like it

looking fwd to this chinese round .. will surely become rated this time :} Also i wanna congratulate all chinese people for their nation's outstanding performance in paralympics , love from north korea

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

All set to become newbie again. Here we go again.

»
5 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

I'm gonna do good in this contest.

»
5 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

There might be a game theory problem, guessed from the alice and bob tag :)

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

what the hack is MEX and link is no opening too

»
5 years ago, hide # |
 
Vote: I like it +91 Vote: I do not like it

digitforces

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Great Problems. Specially Problem E.

»
5 years ago, hide # |
 
Vote: I like it +16 Vote: I do not like it

so i had to lose around 400 points because i didn't know x^b==a and (x^b)==a aren't the same (-_-) if you know you know

»
5 years ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

Good contest! But I think that there is so many math problems, like B,C ans D :(

Now I have a chance to improve my math skills.

»
5 years ago, hide # |
 
Vote: I like it +18 Vote: I do not like it

I know that I am dumb but daaaamn question C is tough.

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

nice contest, thank you ScarletS

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I spent 45 mins cause curr_xor^b is different from ((curr_xor)^(b)) (-_-)

  • »
    »
    5 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    i dont get it....how is it different...can u please share any resources?

    • »
      »
      »
      5 years ago, hide # ^ |
       
      Vote: I like it +3 Vote: I do not like it

      Its not different , its just that:

      When you do (a^b == c) the compiler actually does a^ (b==c) because of the precedence of operators. so (a)^(b) == c is basically (a^b) == c which is the correct version

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

If I fail system tests I'm going to kill my self and it's your fault, I'm finally getting to CM !!!

»
5 years ago, hide # |
 
Vote: I like it +46 Vote: I do not like it

I think the difficulty ranking is:

A<B<E<D<C<F.

»
5 years ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Overwhelmed by sadness

»
5 years ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

What's the solution for E?

  • »
    »
    5 years ago, hide # ^ |
     
    Vote: I like it +17 Vote: I do not like it

    Segment tree where for each node we store the total number of good subarrays, the lengths of the longest prefix that is good and the longest suffix that is good, and the first value and the last value of the interval

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Came up with the solution for E after a glance but it seemed that my brain is "voidily" than any black holes in the whole universe for C and D.

»
5 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Nice contest, finally a Div.2 B with normal difficulty.

»
5 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

If my F passes, it will be my first time reaching Master :D

But I think my F solution can fail, it looks too simple. It is only bipartite matching.

  • If a marked cell has one or three adjacent unmarked cells, there is no solution
  • If a marked cell has two unmarked cells connect them with an edge
  • If a marked cell has four unmarked cells connect the top and left cell with an edge, as well as the bottom and right cell with an edge.
  • Then do assignment of colors with bipartite matching.
  • »
    »
    5 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I came up with the same idea when I saw problem F, but I don't know how to proof its correctness and I don't think the solution is right......

    So why is it correct......it seems that the solution passed the system test.

    • »
      »
      »
      5 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      During the contest, I tried to construct a counterexample to my approach by I could not. Probably I should have submitted my solution earlier.

      The proof of correctness is explained in the editorial.

      But my D failed systests, so I guess no Masters for me :/

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

How to solve problem C ?

  • »
    »
    5 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it +9 Vote: I do not like it

    note that if you build 2 numbers:

    1. number from odd positions = x

    2. number from even positions = y

    then, those numbers are correctly computed during the process. so the answer will be: (x + 1) * (y + 1) — 2. (because those cases for each number are disjoint)

  • »
    »
    5 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    Let poss(x) = number of ordered pairs (a,b) such that 0 <= a,b <= 9 and a + b = x. You should with some casework or bruteforce. Also let dp[i][j][k] be the number of ways to fix the ith digit to the last digit with carry j for i-2 and carry k for i-1.

    We can make the recurrence dp[i][j][k] = dp[i+1][k][0]*poss(s[i] + j*10) + dp[i+1][k][1]*poss(s[i] + j*10- 1), and with it, the answer will be dp[0][0][0]-2.

  • »
    »
    5 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I applied bitmasks to calculate for which positions get a carry and which do not.

»
5 years ago, hide # |
 
Vote: I like it +55 Vote: I do not like it

I think maybe problem E is too easy for a div2E.

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Problem C is a good idea!

»
5 years ago, hide # |
 
Vote: I like it +53 Vote: I do not like it

ScarletS I am sorry to say that, but the problems C and D are of very questionable quality, as for my taste. I even know some people (from post-contest discussions) who would ask you to stop creating problems (in a very cf-toxic manner). Instead, I want to ask you to keep going. I believe in you, and hope that your next contest will be better!

  • »
    »
    5 years ago, hide # ^ |
     
    Vote: I like it +16 Vote: I do not like it

    The only toxic things here are the problems.

  • »
    »
    5 years ago, hide # ^ |
     
    Vote: I like it +63 Vote: I do not like it

    Funny that you say that, because IMO C is one of the most genius easy problems I have seen in a while.

    • »
      »
      »
      5 years ago, hide # ^ |
       
      Vote: I like it -41 Vote: I do not like it

      Same for D. Only some observation in D and an easy DP in C.

    • »
      »
      »
      5 years ago, hide # ^ |
       
      Vote: I like it +22 Vote: I do not like it

      Well, there will always be some unhappy people. For example, I don't like digit-related problems in general, so my opinion is clearly biased. What I was saying is "don't take all comments personally, even if they come from div 1 users"

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can anyone tell me what's wrong with my code, problem C. I used brute force approach

code
  • »
    »
    5 years ago, hide # ^ |
     
    Vote: I like it +8 Vote: I do not like it

    You should take one test, output pairs you've found, compare them to given solution in problem statement and look into your logic — why they don't match. It's called debugging, this is part of problem solving you should get used to.

»
5 years ago, hide # |
 
Vote: I like it +51 Vote: I do not like it

I think it was probably the worst round I've ever in.

»
5 years ago, hide # |
 
Vote: I like it +12 Vote: I do not like it

swap(C,E)

»
5 years ago, hide # |
 
Vote: I like it +41 Vote: I do not like it

»
5 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

solved A,B under 30 mins and failed to implement C for 1 and a half an hour :(

»
5 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

Should've seen E first, spent 1 hour implementing D.

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I solved $$$B$$$ in $$$19$$$ minutes, $$$C$$$ in $$$1$$$ hour and $$$13$$$ minutes, and $$$E$$$ in $$$16$$$ minutes. I'm still shocked :)

»
5 years ago, hide # |
 
Vote: I like it +12 Vote: I do not like it

Where is the interactive problem?

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Test case 5 killed me in D :(

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Why already system testing, but I still have B on "Pretests passed"?

»
5 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

»
5 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

Last 10 minutes brought 200 + Successful submissions on both D and E , amazing.

»
5 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

ready to be specialist again :(

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

When solving problem B, spent too much time thinking that $$$a$$$ was supposed to be the smallest non-present number in the array among those that are positive and got the whole contest derailed because of this. After a long debugging session wondered why [1, 10001] was not a correct answer for the a=2, b=10000 testcase and then checked the problem statement again.

Now I wonder what was the purpose of the a >= 1 constraint in the first place? The problem would be still solvable if $$$a$$$ was allowed to be 0. It's entirely my fault, but reading comprehension played a major role here and if this was the contest authors' intention, then they surely achieved their goal.

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Missed an AC in E by 3 minutes , Sad life :(

»
5 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

I enjoyed this contest.

Thank you for the nice problems.

»
5 years ago, hide # |
 
Vote: I like it +47 Vote: I do not like it

Ratings updated preliminarily. We will remove cheaters and update the ratings again soon!

»
5 years ago, hide # |
Rev. 10  
Vote: I like it 0 Vote: I do not like it

@below oh i must have missed it when I read it thanks

  • »
    »
    5 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Actually no. I think it's better to read Codeforces instructions to avoid downvotes

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

thx

»
5 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

I didn't like C and D, but F was pretty nice.

»
5 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

C: just another standard digit dp problem.

E: just another standard segment tree problem.

Downvoted.

»
5 years ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

AliceForces!

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can someone check why my submission for problem D failed? I just did the carrying one by one starting from the rightmost digit of $$$s$$$.

»
5 years ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

One of the best problem sets in recent times. Thanks ScarletS and flamestorm for the contest! :)

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I think I have wrote a wrong F but it passed !

Compare submission 127972613 with submission 127978516 , I think that I only change the left and right when a 'X' has 4 '.' neighbors .

I think I can be Up Hacked.

»
5 years ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

Problem C is beautiful. I love it.

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

A: U->D D->U L,R unchanged B: Preprocess the exclusive OR of 0~n-1 and judge with m

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Please update problem ratings.

»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hi regarding Question C of this round (742) ,the test case number 3 where input of n is 8 ,the output is given as 7 whereas it should be 9 . What I mean is that to make 8 according to question we have following pairs : (`1 ,7),(7 ,1) ,(2 ,6),(6 ,2)(4 ,4),(5,3),(3 ,5) ,(8 ,0),(0,8).This adds to total of 9 .Can anyone tell if its right . Here is the question link : **https://mirror.codeforces.com/contest/1567/problems** Thank you for your time .

  • »
    »
    5 years ago, hide # ^ |
     
    Vote: I like it +11 Vote: I do not like it

    Notice that the statement asks for the number of ordered pairs of positive integers, so $$$(0,8)$$$ and $$$(8,0)$$$ don't count, as $$$0$$$ is not positive.