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

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

Ciao, Codeforces! We're glad to invite you to take part in Codeforces Round 975 (Div. 1) and Codeforces Round 975 (Div. 2), which will start on 27.09.2024 16:35 (Московское время). You will be given 6 problems and 2 hours and 30 minutes to solve them in both divisions. Some problems will be divided into subtasks.

UPD: the time has been changed to 27.09.2024 16:35 (Московское время), which is different from the time announced before. Please note the unusual starting time.

This round is based on Italian Olympiad in Informatics (OII) 2024.

The problems were authored by lorenzoferrari, wksni and me.

We would like to thank

Score distribution:

  • Div. 1: $$$500 - 750 - 750 - 1500 - (2250 + 750) - (1500 + 1500 + 1500)$$$
  • Div. 2: $$$500 - 1000 - 1750 - 2000 - 2000 - 3000$$$

We hope you'll like the problemset!

Update 1: the editorial is here.

Update 2: congratulations to the winners!

Winners and first solves
  • Проголосовать: нравится
  • +580
  • Проголосовать: не нравится

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

As the first commenter.. thanks for the div1 contest.

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

do i wake up at 1 am to do this?

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

I'm sure this round will be cool !

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

This is an odd timing tho, anyways this will be my first contest

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

no offense or anything but i never understand your round editorials so please focus on them being good this time

edit : also include proofs most recent rounds i feel like we get the solution thrown at us with no proof or anything attached last round problem D is an example

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

Cool, another round I won't be able to attend

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

‎‎‎‎‎‎‎‎ㅤ

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

is it possible to reschedule it to 20:05 utc+5.5 on friday, if then please do it. otherwise no problem,I will have to do it virtual, because in daytime i will be in my office for friday, or you can make it saturday the same time. It's not a problem to miss contests for unavoidable reasons but if possible, I don't want to miss it.

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

People who use AI, why are you doing this? Besides the fact that it is forbidden, it also kills all the interest of the competition. What is the interest of such submission if in the end they will not give anything in terms of experience, and the account will still be banned.

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

that is 11 in the morning for me ._.

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

I hope the time will be changed to 22:35(UTC+8:00) as usual.

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

Great time for me. Hope for more.

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

I want to know if I can participate div.1 with the score as low as me and if I can only participate div.2 or I can participate both.

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

1:35 pm for me it will be great I am gonna skip college class that day

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

finally, a contest at a good time for Americans

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

Is the score distribution for Div1 and Div2 correct ? Since when did Div2 C become 1750 rated ? I think there's been a typo ?

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

why the unusual starting time ?

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

Unfortunately, I have school at this time :(

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

Weirdest way to skip a Div1: possibly coinciding with team meeting at work...

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

cool time in general, but not in friday XD

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

he really has the last name "ferrari", impossible.

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

As a tester, I hope no one will be using AI instruments (^˵◕ω◕˵^)

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

As a tester, I wish all of you a good luck!

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

Div1 is too few. More plz :)

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

Why use Ciao instead of Ciallo(✿◡‿◡)?

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

Oh no, it’s 16:05 in China. I am in school that time, bad luck to miss a div1 again.

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

As a tester, I'm so happy to be able to say that!

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

my strategy: stare problem C for 30min if ! solvable goto bed

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

I'd participate if it was 6 hours or a day later. This is a big F you to students and working Americans and Europeans.

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

Aren't the ratings for the rounds swapped?

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

swap div1 with div2

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

Waiting a month for a div1 only to get a 4am round :(

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

isnt the scoring distribution for div 1 usually higher

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

Wow, this is a very suitable match time for our Chinese compatriots, and I am looking forward to having a good performance :)

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

Now I will give div-1 or div-2? Div- 1 looks more scorable than div-2. And div-1 rated range?

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

very interesting distribution for div1.....maybe consider increasing time?

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

Why Flamire is the $$$\text{V}\color{red}{\text{IP}}$$$ tester but le0n isn't?/kel

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

Every time i open CF, the score distribution changes.

UPD — They changing time now as well.

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

Why was the start time of the contest changed?This is not very friendly to me in China.

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

Thank you for adjusting the time

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

Sorry for changing the starting time. I've just known that there is a OII contestant who participates online. With the previous starting time, he could access Codeforces and the submissions before the end of the official OII round.

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

A div1 after such a long time, but on a weekday afternoon, Have to wait for the next one now :((

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

jeroenodb is so orz

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

hope it will not have any interactive problem :)

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

The rare daytime div2 in China has disappeared …

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

D=F1<E1<F1+F2=E1+E2<F1+F2+F3

I have to say that strategy can play a huge part in this contest for IGM/LGM participants...

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

Looking at the gap between B-C in div 2. I have to mentally ready for hard problem this time.

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

Why did you move the contest to 16:35 utc+3?

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

Hope to reach CM :D

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

My local time is 21:35 (UTC+8), which is within my acceptable range. Can you tell me what time it is there?

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

Hi

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

Is it safe to assume its a typo that the div 1 score distribution is easier than the div 2?

  • »
    »
    20 месяцев назад, скрыть # ^ |
     
    Проголосовать: нравится +29 Проголосовать: не нравится
    1. Scores do not represent absolute difficulties of problems. Only the relative difference (or ratio) within a single round matters.
    2. Div. 1 and Div. 2 are separated, so you get nothing by comparing a problem's score on Div. 1 to a Div. 2's problem.
    3. Therefore, there is nothing wrong with Div. 1 having lower score distribution than Div. 2.
»
20 месяцев назад, скрыть # |
 
Проголосовать: нравится +39 Проголосовать: не нравится

As a tester, I tested.

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

Ugh have to skip this due to change in time. My sleep cycle forces me to sleep at 5-6 these days. Atb everyone

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

speedforces!

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

Why Candidate Master is now div1? It was div2 last contest.

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

    Candidate Masters are Div. 1 when it's a Div. 1/2 parallel round. They are also rated in Div. 2- only rounds, but cannot participate in Div. 2 when there is a parallel Div. 1 round.

    You realize that we have had too few Div. 1/2 parallel rounds recently when you see a bunch of questions like this...

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

Hope tourist can come. But, can he keep the red-black name?

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

Is such rounds based on OII doesn't concern on advanced topics probelms?

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

    i assume the harder problems(div2E+ or div1B+) will have similar ideas as problems on the olympiad, or might even be the same. i doubt that regular div 2 ABC could be actual olympiad problems, so that will probably only be relevant for the harder problems

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

unrated not allowed ?

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

Finally there is a competition that time allows to participate.

Good luck everyone!

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

ez for me

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

Update for Div1C,this is like the 5th time you change score distribution.COME ON!!

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

Wish to get some plus

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

great start time!

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

Why Flamire is vip? I'm jealous now

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

Why the odd timing?Already got least contest in this month and now missed this contest too

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

    It's based on the Italian olympiad.

    So they put the online contest as close as possible to the onsite contest to avoid leaks.

    Also they explicitly warned about the unusual start time in the announcement

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

Why start early? I lost an hour of problem-solving time!

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

nutella coordination means?

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

TheScrasse never let me down ! , Thanks for brief statement and amazing contest !

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

Div2E >>> Div2D

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

Even after like a million submissions idk why my binary search solution on C won't work DAMNIT!

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

trash problems I lost rating because of them

just kidding, the A-D Div.1 problems are actually nice, a bit easy for their place though :D

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

Why give constraints with long long without notice? I got 2 TLE because I read k with fucking int.

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

Div1E: The usage of the term "(sub)set" is not standard because it allows (multi)sets. I asked about this, but it is weird that no annoucement was made.

--

Div1F: Since I felt this is close to cheating, I asked "If we lock problem B, we can make hacks on B (without solving F)?" and received "Yes". After that I found out I can check submissions only from my room (right?). I think this is unfair and the settings for hacks should be checked more carefully.

I have to admit that I gave up joy to "solve" the problem alone for speeding up... By the way the problem itself was fun! (though a bit easy for its position)

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

This round reminds me of Moscow Open Olympiad in Informatics rounds :)

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

Do you play GD btw?:)

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

TheScrasse Your rounds are absolutely fantastic everytime man! Nice problems, thanks for the round!

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

D is really great!

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

I got cancer while debugging Div2E/1C

isn't this really just compute all distance from root

then from 0 to maximum distance, compute operations require (remove all greater, remove all lesser, adjust by cnt[k] because there will be path) to make every leaf have distance of k? then take whatever minimum.

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

C++ on CF (maybe memory allocation?) is unwelcomely slow.
My F1 works around 6000ms in AtCoder custom test with 1 500 998244353, but the custom invocation of CF says it's TLE(>15000ms).

UPD: It seems not only memory allocation, but also totally slow.
My fixed F2 said 3600ms on CF, but same case runs around 1000ms on AtCoder.

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

Cheating in this round started from 80' onwards. Problems 2C and 2E solved by lot of newbies from around that time.

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

My solution to problem C was not run on the system tests. Is it a bug?

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

div1 F can be solved in $$$O(n)$$$. Let's fix our final segment $$$[l,r]$$$. Let's compute a dp[segment] such that the segment has $$$[l,r]$$$ inside it. We know that there is at least one of the bounds of the current segment such that it is not inside $$$[l,r]$$$ and it is at least (length of our segment+1). We can remove it, and we can make a dp in order of decreasing of a segment length. But there can be two such bounds for a segment, so we should use inclusion-exclusion. It is $$$O(n^{2})$$$ right now (dp is the same for all intervals), but we don't need to store the segment, we only need to store its length, so we can make it $$$O(n)$$$. (When we go to our segment in dp we must add some number of ways to place the numbers inside it to the answer of its length).

Now we calculate the number of segments of length $$$k$$$ lying inside the final segment, and from this we can get the number of final segments of length $$$k$$$ in $$$O(n)$$$.

Code

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

well I gained + 172 and successfully doing ABCD in reverse order.

what i am not pleased with is the problem E, why it is so easy?

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

Congrats Dominater069 for rank 56. I always wonder, how do you manage to be so so consistent in your performance, always, unlike most. Its insipiring. The rating graph is just absolute perfection. Wishing you to steadlity rise to the rank of LGM.

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

Thanks TheScrasse for this nice contest.  First time I became CM 

The first time I became an expert was also in your contest.

I hope you make another contest as soon as possible to become master. 

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

Problem Difficulties:

A2 — 800

B2 — 1000 (weirdly I found it harder, due to awkward implementation, for me it was like a 1400).

A1/C2 — 1400

B1/D2 — 1900

C1/E2 — 1900

D1/F2 — 2500

Did not try to seriously solve anything harder.:)

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

can anyone solve "cards partition problem"-by using binary search

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

I have a strict $$$\mathcal{O}(n)$$$ approach to the Div1 C problem, which uses long-chain partitioning to optimize dynamic programming on trees.

283907902

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

I was just warned about coincides solutions in problem C Div2 Round 975 with another person and below is my explanation Solution coincides but Problem C is simple enough and the chances are higher for coincidence. This happens because question C Div2 of this round is actually quite simple without using any special algorithm to solve it. Just brute force the number of each type card and you can solve it ! This leads to someone having the same idea of ​​solving this problem as me and causing unnecessary duplication In addition, I was warned for repeating question B, but after I checked the account of the person who coincides with me .Again, I solved this problem before he solved it Please look into this matter and don't penalize me unnecessarily.THANKS A LOT!!

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

    If the coincidence occurs due to the template I am using. Then you can check my previous submissions from the time I created my account until now, I still use it like that. And this template is also extremely popular but has two more features of mine. //++i //'\n' In this case, I really didn't mean it and I sincerely apologize for it. If possible, in the following contests, I will change my template to avoid affecting others as much as possible THANKS AGAIN!!

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

I want to address the notification I received about my submission for the problem 2019B - All Pairs Segments. I’d like to clarify that the formula and approach I used were developed independently by me.

While working on this problem, I drew on my understanding of the line sweep algorithm from 1000C - Covered Points Count, which I have seen before. That problem also deals with segment contributions and efficient calculations, which helped me think through my solution for "B. All Pairs Segments" and arrive at the solution.

The solution I submitted was based on my insights, and I created a new formula to calculate each segment's contribution efficiently, specifically for this problem. I made sure my solution was original and not a copy of anyone else's work.

I kindly request you to reconsider the situation associated with my submission. Thank you for your understanding.

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

    yeah same and that formula was also used in editorial everyone has used same formula mine was skipped bcz it matches with 283209041 this solution but it isn't he has used some strings I don't know why he even use unordered map and I used map only and I used pretty famous naming conventions IDK why it got skipped I didn't cheated at all I never cheat

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

I have received a mail that my solution https://mirror.codeforces.com/contest/2019/submission/283247602 "coincides" with some other solutions. For example, it matches with https://mirror.codeforces.com/contest/2019/submission/283226239. If you check these links you will see that the way of writing the code is completely different. The only thing that matches is the logic for doing the problem. It is the same with all the other submissions mentioned in the mail. Now, the problem is that I did not cheat. This is a fairly simple logic to think of. If you look at my submission, you will see how simple of a logic it is. Also, the only thing matching with other solutions is the logic. When the problem is fairly simple and so is the logic of solving the problem, similarity in the code is bound to happen. Basically, anybody who has thought of this logic will be punished if such checking is done. Maybe this is because of the new AI regulations which is making the system "overstrict" and causing problems like these. Kindly look into this issue.

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

CP is wasting of my talent I am much smarter than CP