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

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

text Ciao, Codeforces! We're glad to invite you to take part in Codeforces Round 1066 (Div. 1 + Div. 2), which will start on Nov/23/2025 12:35 (Moscow time). You will be given 9 problems and 3 hours to solve them in both divisions. The round will share some problems with The 2025 ICPC Southwestern Europe Regional Contest (SWERC) 2025.

Note the unusual starting time.

Some of the problems might be interactive, so please read the guide for interactive problems if you are not familiar with it.

The problems were authored and prepared by KLPP and me.

We would like to thank

The score distribution will be announced after the onsite contest starts.

We hope you'll like the problemset!

UPD 1: The score distribution is as follows:

$$$500 + 1000 + 1500 + 1500 + 2000 + 2500 + 3000 + 3750 + 4000$$$

UPD 2: Upsolving & viewing of solutions and tests will be closed until the end of the onsite contest (13:30 UTC, 1 hour after the Codeforces round ends). Please also refrain from discussing the problems in public until that time.

UPD 3: Congratulations to the winners:

UPD 4: The editorial is out.

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

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

As a tester, I found one problem in this contest very nice, and recommend you to participate.

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

as a commenter, I commented very fast.

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

please share the score distribution

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

Wait, you mean, NINE problems within just THREE hours? This is really kind of ICPC style qwq.

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

Touch glass

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

Will people like me lose rating from div1+div2s?

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

Is it rated? IAKIOI

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

As not a tester, I think the problems in this contest are very nice, and recommend you to participate. :)

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

I'm pretty sure that the onsite contest already started, where's the score distribution

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

As a tester, I want to know why you're not playing Honkai: Star Rail.

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

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

Will the problems still be in rough difficulty order or random like ICPC?

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

As a tester , I feel that the contest is great and I recommend to participate

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

What sort of difficulty should I expect?

I've just started on this website (yesterday) and have enjoyed my time so far.

Just wondering how hard this is going to be on a difficulty scale.

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

What is the difficulty of this problem? This is my first time getting an email and I don't know if it is very hard or very easy.

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

If i don't get Cyan today, strap me up.

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

As a participant, I did not read that this contest starts a little early. As a result, I will now be doing this on mobile in chemistry class.

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

First time learning about interactive problems! I know div 1 and div 2 is out of my reach for a newbie, but I shall try my best!!

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

Lucky enough to look at the unusual timing just 1.5 hrs before the contest

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

btw can I see the live scoreboard for SWERC somewhere?

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

Where is the hacking-disabled zone for this round?

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

The contest starts in 4 minutes. GLHF guys!

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

As a human, I am a human

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

cool B

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

why is my solution being skipped while the contest is still live

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

Upsolving & viewing of solutions and tests will be closed until the end of the onsite contest (13:30 UTC, 1 hour after the Codeforces round ends).

Please also refrain from discussing the problems in public until that time.

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

Uh missed the contest..should have looked at the unusual time :(

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

Is there a rating-predictor in Codeforces?

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

big +delta for me, I like it

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

really awesome b ; i couldnt properly impelement the solution to c , for 2nd time in my life i solved c 2 min after the contest ended :(

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

C is rubbish

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

Fun fact: I also independently submitted a problem that was almost the exact same to D to propose for a Codeforces contest. It was turned down :p

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

The contest was really amazing. Thanks for arranging such a nice contest.

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

Fun problemset!

Upsolving & viewing of solutions and tests will be closed until the end of the onsite contest (13:30 UTC, 1 hour after the Codeforces round ends). Please also refrain from discussing the problems in public until that time.

This is a bit awkward to ask everyone to do (specially since it's an announcement not many people will read). Wouldn't it be better if the round happened 1 hour later then? Were setters just not available at that time?

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

My first time in a div1&2 contest

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

E<D

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

How to solve E?

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

    It's not that hard to see that this problem is easier to do with a frequency map.

    From observations you can get that when, for some $$$i$$$, $$$f_i \gt k$$$, then you have to move $$$f_i-1$$$ drones from energy $$$i$$$ to $$$i+1$$$, so basically $$$f_{i+1}:=f_i-1,f_i:=1^{(1)}$$$ ($$$:=$$$ means assignment).

    Let's define a chain reaction when $$$f_i \gt k$$$, and we advance the drones of $$$f_i$$$ to the right (thus incrementing $$$i$$$) until $$$f_i≤k$$$, leaving a trail of $$$1$$$s behind. At the end, if we started from $$$s$$$ and ended at $$$i$$$, the total number of operations that chain reaction did was $$$i-s$$$. Let's save all trails of ones in an array $$$jump$$$, in the format $$$jump_s=j$$$.

    Any chain reaction passing on an existing trail of $$$1$$$s (which starts on position $$$j$$$) will, after $$$jump_j-j$$$ operations, continue from $$$jump_j$$$ without changing the trail (ofc it will leave it's own trail of $$$1$$$s, but $$$1=1$$$, so the elements of $$$f_{j:jump_j}$$$ won't change).

    So, our answer to the problem will be the longest chain reaction. Of course, every chain reaction has a constant rate, so no chain reaction can "catch up" to another ongoing, which means it's safe to simulate chain reactions from the right, to the left.

    This means we can have a variable $$$s\in{2n,\dots,1}$$$, and we can check if $$$f_s \gt k$$$. If this is true, we start simulating the chain reaction from $$$f_s$$$, with $$$(1)$$$. If we get to $$$i$$$ where $$$jump_i$$$ is set, we can skip a lot of indexes, which saves runtime and reduces energy consumption, thus slowing down global warming. At the end of the chain reaction, if the length of this chain reaction is the largest ever, we save it ($$$m:=max{m,i-s}$$$).

    Implementation: codeforces.com/contest/2157/submission/350326830

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

Appreciate the starting time.UTC+8 is a timezone that is very difficult to participate in usual contests for high school students.Will CF hold more contests at different starting times?

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

about F and G: sorry I'm not your GF.

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

the type of fumble I do when I'm 9 away from expert. Did well in my ICPC region too :(

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

ak+q is great!

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

For Problem G, it seems easier to guess the solution than to prove it. The real challenge is mustering the courage to implement an idea you’re uncertain about.

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

Where can I see onsite standings?

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

F. G and H are both non-traditional questions that catch people off guard, and there are some random distinguishing elements for participants with scores less than or equal to 3000.

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

wtf H brute searching is correct

so shocked, so what's the intended solution

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

can someone suggest me the fix for C on top of my solution, thanks!!! https://mirror.codeforces.com/contest/2157/submission/350367577

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

Will this round be another case for this?

Edit: Seems that it has been fixed now.

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

C+D > F

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

When will the editorial be released? I look forward to reading it.

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

Is there anybody who used ternary search for problem D?

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

Can anyone help me with a testcase why am i wa on test 5? https://mirror.codeforces.com/contest/2157/submission/350344325

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

    Probably you have to sort the mex intervals by their left boundaries? I see your code is similar to mine, and I mistakenly assumed that the intervals are in order so filling the mex intervals might be problematic (e.g., three mex intervals overlap with each other, and we filled the first and the last before filling the one in the middle). Didn't really look into the details tho, just a guess.

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

      i have filled the values greedily, Lets say — k=3, and interval is (3, 5) and (1, 4). So first i will add the values in (3, 5). Next when filling values for (1,4) i will check which all values are already there in this interval. In this case index 3 and 4 are already filled with 0 and 1 respectively. So I just need to add 2 in index 1 for completing interval 2.

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

when will editorial be available

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

During contest, For problem E, I went in wrong direction. It is very easy with monotonic stack. Probably easier than problem C or D.

https://mirror.codeforces.com/contest/2157/submission/350385547

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

Does anyone have spare time to explain F to me? I thought of sqrt decomp ($$$250000=500^2$$$) or cbrt decomp ($$$250047=63^3$$$). Unfortunately, the closest I got is 15 million robocoins, with the cube root. I don't ask for mathematical proof (99% I can prove it myself), but the idea.

Asking because I underperform in reading other people's code (aka suck at it)

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

    My solution uses $$$~9.5e5$$$ operations.

    Split number segment $$$[1, 250000]$$$ into blocks of size $$$100$$$.

    $$$[1, 100], [101, 200], [201, 300], \dots$$$.

    Let's do following operations: $$$\dots, (201, 1), (101, 1), (1, 1), \dots, (202, 1), (102, 1), (2, 1), \dots, (203, 1), (103, 1), (3, 1), \dots$$$. This way level will become divisible by $$$100$$$. We will spend $$$250000 + 1000 * 100 = 3.5e5$$$ operations.

    Now split remaining numbers into blocks of size $$$100$$$ again.

    $$$\{100, 200, \dots, 10000\}, \{10100, \dots, 20000\}, \{20100, \dots, 30000\}, \dots$$$.

    Let's do the same thing: $$$ \dots, (20100, 100), (10100, 100), (100, 100), \dots $$$. This way level will become divisible by $$$10000$$$. We will spend $$$3.5e5$$$ operations again.

    We have $$$25$$$ numbers remaining. Let's solve them trivially from smallest: $$$(10000, 10000), (20000, 10000), (30000, 10000), \dots$$$. We will spend $$$250000 + 1000 * 25 = 2.75e5$$$ operations.

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

      isnt that 9.75e5 (roughly)
      but if u actually count it should be lower by a bit (iirc)

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

      Why is splitting by dividing by 100 the best solution

      Like shouldn't dividing by 2 the best solution

      I thought about converting all number Divisible by 2 Than divisible by 4 And so on till 1024

      After that from lowest to biggest (1024,1024) , (2048. 1024), each will cost 1024 + 1000

      But was able to get a solution of 2e6 coins

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

    I use the cube root too.

    Split $$$[1,250000]$$$ into blocks size of $$$64$$$ is enough.

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

      Looking at your code. How did I not think of this… I was so close.

      I also had the idea to put everything at multiples of $$$63$$$ (you did on $$$64$$$, but close enough), but the way I did it wasn't cost-efficient. I did $$$(i,64\left\lceil\frac i{64}\right\rceil-i),i\in250000,\dots,1$$$

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

Could anyone share me some problems that similar to D? I was stuck at D for nearly 2 hours because lack of greedy proof

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

Why in D, statement is written very very confusing??? "After you decide how to deal with all the offers, the actual Billion Players Game is played." After that i started solving the problem thinking first you decide, then value in [L, R] is given. BUT it was oppsosite and very easy ):

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

https://mirror.codeforces.com/contest/2157/submission/350358558

Can anyone help me in proving the correctness of this for today's D? I reached the solution through an observation by plotting on Desmos but can't prove why it works.

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

more people , more use of AI .. less people , less use of AI

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

hi it was nice contest

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

Hello, I received a similarity warning for my solution in this round. I did not share my code with anyone or copy from anyone. It is possible that I once used an online IDE that unintentionally made my code public. I understand this is against the rules even if unintentional, and I sincerely apologize. I will make sure this never happens again. Thank you for checking.

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

@MikeMirzayanov @Codeforces_Team Urgent: My account [AlgoMaster1] cannot view any solutions. Other accounts work fine. Cannot write blog post (no rated contests). Please check account restrictions. Thank you.

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

Regarding solution 350335303, I did not intentionally share my code. I will be more careful in future contests. I truly respect the terms and conditions of codeforces. Thank you.

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

Does anyone have the same problem like me? I can see all submissions before Codeforces Global Round 30, but in a few recent rounds, I am not allowed to view any submissions. Even I can't view my own submissions. Is this a bug or a feature?