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

Автор ScarletS, 5 лет назад, По-английски

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!

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

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

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

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

Really excited for this one!

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

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 лет назад, скрыть # |
 
Проголосовать: нравится +50 Проголосовать: не нравится
»
5 лет назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

surang fan club rise up !

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

ScarletS you had one job!

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

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 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +29 Проголосовать: не нравится

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

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

I know that this will be a high quality round.

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

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 лет назад, скрыть # |
 
Проголосовать: нравится +27 Проголосовать: не нравится

Unban from server

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

By the way, who is saarang? @saarang

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

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

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

time to upsolve this

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

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

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

Good luck for everyone!

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

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

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

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

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

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

He loves his team name

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

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

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

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 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Ready to become newbie again

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

支持此比赛!

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

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 лет назад, скрыть # |
 
Проголосовать: нравится +34 Проголосовать: не нравится

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

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

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

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

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 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

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

I'm gonna do good in this contest.

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

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

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

what the hack is MEX and link is no opening too

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

digitforces

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

Great Problems. Specially Problem E.

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

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 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

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 лет назад, скрыть # |
 
Проголосовать: нравится +18 Проголосовать: не нравится

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

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

nice contest, thank you ScarletS

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

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

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

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

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

I think the difficulty ranking is:

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

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

Overwhelmed by sadness

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

What's the solution for E?

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

    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 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

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

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

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 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve problem C ?

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

    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 лет назад, скрыть # ^ |
    ← Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    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 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

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

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

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

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

Problem C is a good idea!

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

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 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

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

    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 лет назад, скрыть # |
 
Проголосовать: нравится +51 Проголосовать: не нравится

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

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

swap(C,E)

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

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

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

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

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

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

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

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

Where is the interactive problem?

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

Test case 5 killed me in D :(

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

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

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

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

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

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

ready to be specialist again :(

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

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 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

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

I enjoyed this contest.

Thank you for the nice problems.

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

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

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

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

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

thx

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

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

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

C: just another standard digit dp problem.

E: just another standard segment tree problem.

Downvoted.

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

AliceForces!

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

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 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

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

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

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 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Problem C is beautiful. I love it.

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

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

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

Please update problem ratings.

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

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://codeforces.me/contest/1567/problems** Thank you for your time .