zltzlt's blog

By zltzlt, history, 4 months ago, In English

(After 3 months) Hello again, Codeforces!

We are glad to invite you to participate in Codeforces Round 968 (Div. 2), which will start on Aug/25/2024 17:35 (Moscow time). You will be given 6 problems and 2 hours to solve them. Two problems are divided into two subtasks.

This round will be rated for participants whose rating is below 2100. Participants with higher rating can participate unofficially.

The problems were authored and prepared by me.

I would like to thank:

Scoring distribution: $$$500 - 750 - 1000 - (1000 - 1250) - (1750 - 1000) - 2500$$$.

Good luck & Have fun!

UPD1: Editorial and also Simplified Chinese Editorial are out.

UPD2: Congratulations to the winners!

Div. 2:

  1. Empty_Dust
  2. cz_yxx
  3. Hosen_ba
  4. farkon00
  5. _minhduccp

Div. 1 + Div. 2:

  1. jiangly
  2. ksun48
  3. kotatsugame
  4. Sugar_fan
  5. Golovanov399
  • Vote: I like it
  • +449
  • Vote: I do not like it

»
4 months ago, # |
  Vote: I like it +27 Vote: I do not like it

Auto comment: topic has been updated by zltzlt (previous revision, new revision, compare).

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +2 Vote: I do not like it

    Hoping to cross 1700 in this contest ^-^

    Reality
  • »
    »
    4 months ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    Hope I can reach Specialist qwq

»
4 months ago, # |
  Vote: I like it +71 Vote: I do not like it

As a tester, there are some beautiful ideas in the tasks, and I encourage everyone to participate!

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Is there a big gap between the levels of B and C like old contests?

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it +11 Vote: I do not like it

      I doubt he is allowed to share that info, and even if he did share, difficulty is subjective.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      No. Compared to the old one, the questions for this competition have been adjusted to make the difficulty distribution more reasonable. :D

»
4 months ago, # |
  Vote: I like it +26 Vote: I do not like it

It will be my second contest in Codeforces, and I am looking forward to it!

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    How is your E1 from today already skipped with no resubmissions? And how come your "first" contest 3 months ago was set by the same author?

    There's no such thing as a coincidence

»
4 months ago, # |
  Vote: I like it +10 Vote: I do not like it

First rule of fight club is: "Don't trust the scoring distribution. Especially if it's a Chinese round."

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yeah I thought of maybe till D(easy version) can be easy but since u warned I am gonna try till C

»
4 months ago, # |
  Vote: I like it +43 Vote: I do not like it

As a tester, I not only tested, but also tested twice. There may be some unforgettable problem. Enjoy it!

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +4 Vote: I do not like it

    now that sounds scary

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    This really sounds scary.Will this haunt me for the rest of my life?

»
4 months ago, # |
  Vote: I like it +34 Vote: I do not like it

As a tester, GL&HF

»
4 months ago, # |
Rev. 2   Vote: I like it +31 Vote: I do not like it

Me looking at the setter:

  • Their last contest nearly dropped me down below 1700.
  • This time they had two subtask-enabled problems, adding consistency dread and doubts regarding tactics.

Oh dear... Welp, at least this time I'm out-of-competition so I'd be safe... :D

»
4 months ago, # |
  Vote: I like it +9 Vote: I do not like it

hoping to not reach green after this one

»
4 months ago, # |
  Vote: I like it +34 Vote: I do not like it

As a tester and a fan of zltzlt, zltzlt orz.

The problems are nice, gl&hf!

»
4 months ago, # |
  Vote: I like it -96 Vote: I do not like it

As a tester I cried because how beautiful the problems are

»
4 months ago, # |
Rev. 2   Vote: I like it +7 Vote: I do not like it

You

for participating. was cool
»
4 months ago, # |
  Vote: I like it +8 Vote: I do not like it

Wow,CN Round!

But the Chinese need to stay up late to participate...

»
4 months ago, # |
  Vote: I like it +34 Vote: I do not like it

I'm a tester?! /jy

»
4 months ago, # |
Rev. 3   Vote: I like it -13 Vote: I do not like it

500−750−1000−(1000−1250)−(1750−1000)−2500. what this mean i don't understand the distribution? can anyone explain? Thanks.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    it means if you solve the question A, at the minute 0, you will gain 500 points. if you get a wrong answer verdict on that question the pointes you will get becomes lower, and over time in every minute gets passed, the maximum score that you can get also decreases.

    some problems have subtasks which are marked in parentheses, the first is the score you get if you solve the easy version and the second is if you solve the hard version

  • »
    »
    4 months ago, # ^ |
    Rev. 2   Vote: I like it +4 Vote: I do not like it

    This means

    Problem A: 500 pts

    Problem B: 750 pts

    Problem C: 1000 pts

    Problem D1: 1000 pts

    Problem D2: 1250 pts

    Problem E1: 1750 pts

    Problem E2: 1000 pts

    Problem F: 2500 pts

    Point values decrease if u get one wrong or as time goes on.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

As a participant, I'm waiting for this div to be amazing.

»
4 months ago, # |
Rev. 9   Vote: I like it -38 Vote: I do not like it

No

»
4 months ago, # |
  Vote: I like it +6 Vote: I do not like it

Hoping to get to CM! I'm so close yet so far...

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    good luck

  • »
    »
    4 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I checked your stat on Codeforces Visualizer 4fun. Why on earth you solved 213 800-rated problems and only 9 1900-rated :)

    no blame or something, just curious.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      You might notice my Codeforces streak :)

      When I have school, I quickly solve an 800 rated problem to keep my streak alive. Right now, in my time zone, I have a 239 day streak.

    • »
      »
      »
      4 months ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      It's fine, I've only solved 11 1600 rated problems. He's definitely qualified to reach CM with 9.

»
4 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

hopefully i can get a +1 delta to become specialist after this contest

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I hope this contest will be better for me and eagerly waiting for it...

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

It seems like strategy matters after solved ABC now. Either use speed on D1 E1 or upsolve D2 or E2 (Hope I solved ABC first rofl)

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Hoping to get just 1 more rating

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Hope this contest goes well for everyone. Best of luck to all participants!

»
4 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Time to Ctrl+Z my sanity and dive in!

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

this will be a great round

»
4 months ago, # |
  Vote: I like it +48 Vote: I do not like it

As a tester (but tested E only), E is a good problem!

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Hoping to get a color after this round (⁠ノ⁠^⁠_⁠^⁠)⁠ノ

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yessss You will get the max rank keep participating and trying, From a fellow new member :)

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    How it went brother?

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Looks like my life won't be colorful for the next few contests:'( it went bad

»
4 months ago, # |
  Vote: I like it +11 Vote: I do not like it

Best Wishes!

»
4 months ago, # |
  Vote: I like it +3 Vote: I do not like it

i like tacos

»
4 months ago, # |
Rev. 3   Vote: I like it +15 Vote: I do not like it

Programmers in unlucky timezones participating in this round at 22:35pm:

»
4 months ago, # |
  Vote: I like it +8 Vote: I do not like it

8 problems!

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

welcome again brother @zltzlt . please be affectionate ಥ_ಥ

»
4 months ago, # |
  Vote: I like it +11 Vote: I do not like it

Good luck to all participants!

Wish $$$\mathrm F<{}^*3000$$$ this time :)

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

hope back to expert:)

»
4 months ago, # |
  Vote: I like it +2 Vote: I do not like it

Best of luck to all of you

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Hello brothers. I an ew into this sort of thing so my question is" i see 500 score 750 score " when ever i did any question here on problemset its 800 score so it means these scores are of same category or they are different during contest and problem set.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    these are not problem rating . these are the score you get from the problem.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      see this question "https://codeforces.net/problemset/problem/4/A" here in problem tag i can see *800 or difficulty 800 . So i want to know that score 500 is more difficult than 800 or not thankyou.

      • »
        »
        »
        »
        4 months ago, # ^ |
          Vote: I like it +2 Vote: I do not like it

        When you solve a problem in problemset, it shows you the estimated difficulty rating of that problem. For example, if a problem is rated 1000, that means that a 1000 rated person should solve it 50% of the time in a contest. The 500/750/1000... score of a problem shows how much points you get if you solve it in contest. Generally, harder problems carry more points.

        • »
          »
          »
          »
          »
          4 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Well explained thankyou verymuch for your time.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

hope to become pupil, need to solve first two problems faster.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

potato

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

How can I participate?

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

But i'm Chinese,the time is so late that my mom don't allow me to register for it.But i believe i can register it in 2025.

»
4 months ago, # |
Rev. 3   Vote: I like it +1 Vote: I do not like it

hope you all get +delta this time

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

hey! i usually grind on cf and practice x to x+300 (x is mine current rating) but when i practice i usually stucked on it and cant solve by own and majority of problems i cant solved by own while practicing , is it common or i am just doing some mistakes , please help me

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I think if you solve 800 problems just for improving implementation,it would be better.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I think , i can solve 800 more than 90 percent but i am talking about solving problems higher than my rating

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    stucking is very common everyone gets stuck and reading editorial is not bad then just read the editorial understand it and then implement it simple. If in editorial there is a topic mentioned which u don't know then just read it first then implement the solution with that logic. It is obvious u will get stuck if u are solving higher rating problems

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

thanks

»
4 months ago, # |
  Vote: I like it +3 Vote: I do not like it

mathforces incoming

»
4 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Hope for Salah7_a

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

hoping to get into green with this one

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

so many newbies solved till D2 and here I am not able to understand D1 :(

»
4 months ago, # |
  Vote: I like it +10 Vote: I do not like it

Never been cooked this bad :(

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

solved ABC but I'm too slow... Prolly need more practices sadge

»
4 months ago, # |
  Vote: I like it -7 Vote: I do not like it

aryanc403 beat rainboy today :)

  • »
    »
    4 months ago, # ^ |
    Rev. 4   Vote: I like it +13 Vote: I do not like it

    Meanwhile,

    rainboy [thinking] :===> aryanc403 ... who ! what ! where ! Am I supposed to care !

    PS : I am also fan of Aryanc, but Rainboy has different Aura to him. so, please don't get offended.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      No, nothing offensive, and i know rainboy only solve those problems having low submission count so if he solve last 2-3 problems within 30-40 mins he will not even touch the 4th problem from last, obviously he have a different aura :)

»
4 months ago, # |
  Vote: I like it +31 Vote: I do not like it

GuessForces

»
4 months ago, # |
  Vote: I like it +3 Vote: I do not like it

how to solve B, I honestly have absolutely no idea, was able to guess the correct solution at the end of the contest

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    just print the middle element after sorting!

  • »
    »
    4 months ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    Hint for B:
    -Turtle will always try to eliminate the smallest element present in his operation and if there are duplicate then he will eliminate that which is dangerous to max possible element around the vicinity of all those smallest elements.
    -Piggy in his turn will try to eliminate the largest element present in that operation and if there are duplicate then he will eliminate that which is dangerous to min possible element around the vicinity of all those largest elements.

    Overall Turtle will try to take the result towards larger value and Piggy try to take it towards smaller value and optimally they will end at the value at the mid of the array when sorted.

  • »
    »
    4 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    It's easy to see that Turtle can achieve at least value x, iff there are at least [n/2] values i of array such that a[i] >= x.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +20 Vote: I do not like it

    Consider a similar game, but the move is "remove an element" for both players.

    An optimal strategy is for Turtle to always remove the smallest remaining element and Piggy the largest remaining.

    Observe that the given operation effectively boils down to "remove an element as long as it has a smaller (Turtle) / bigger (Piggy) element next to it. As such, the optimal strategy does not change for either player.

  • »
    »
    4 months ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    The idea of my solution is: Turtle will always remove the current smallest, and Piggy will always remove the current largest (My intuition was that a player should remove the element that is the most disadvantageous to him, or there will remain some element that is disadvantageous towards the end, thus not giving an optimal result to him)

»
4 months ago, # |
  Vote: I like it +26 Vote: I do not like it

How to solve C? D1+D2 feels 100x more obvious to me.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    im ngl i just guessed and it worked. my solution was to count the freq of each character, and then to print all the characters with the current max frequency.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I guessed the same, I'm aiming to print the maximized s[i]!=s[i+1] but I ended up the same strategy as you. I used brute force to check my answer again and it's absolutely fine and doesn't know how to prove it.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I sorted the charachets in descending order of number of occurences.

        string s, x = "";
        int n;
        cin >> n >> s;
        pair<int, char> a[26];
        for(int i = 0;i<26;++i) {
            a[i] = {0, (char)('a' + i)};
        }
        for(const char& v:s) {
            a[(int)(v - 'a')].fi++;
        }
        sort(a, a + 26, cmp);
        while(true) {
            bool ok = true;
            for(int j = 0;j<26;++j) {
                if (a[j].fi > 0) {
                    x+=a[j].se, a[j].fi--, ok = false;
                }
            }
            if (ok) {
                break;
            }
        }
        cout << x << endl;
        return;
    
  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    How to do D1, I tried finding the maximum mex for f(0), then I print the answer mx*(k) for the highest k such that f(k)<=mx otherwise I added m*(m+1)-k*(k-1)/2 to the answer.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I solved it that way, maybe you had a bug in your implementation?

      • »
        »
        »
        »
        4 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        can you help me debug it...

        Spoiler
    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      for every sequence its maximum value you can get from it, is the mex of the sequence with the mex of the sequence included. find the maximum value for that out of all sequences, and then for all values of m that are less than it, replace with that value, and for others you just use the value that is given. the last part is just formula so its a fast solution

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      For a given array $$$a_{i, 1}, \cdots a_{i, l_i}$$$, there are two possible results depending on $$$x$$$:

      • $$$mex(a_{i, 1}, \cdots a_{i, l_i}, mex(a_{i, 1}, \cdots a_{i, l_i}))$$$ if $$$x = mex(a_{i, 1}, \cdots a_{i, l_i})$$$

      • $$$mex(a_{i, 1}, \cdots a_{i, l_i})$$$ otherwise

      So for any array we can achieve $$$mex(a_{i, 1}, \cdots a_{i, l_i}, mex(a_{i, 1}, \cdots a_{i, l_i}))$$$ for any starting value.

      So find the max such possible value among all arrays, let's say it is $$$x$$$.

      Clearly answer is $$$x$$$ for $$$1 \leq i \leq x$$$ and $$$i$$$ for any $$$i \gt x$$$.

      So the sum is $$$(min(m, x) + 1) \cdot x + \sum_{i=x+1}^{m}{i}$$$

      • »
        »
        »
        »
        4 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Yes sir.. that's what I did, don't know why it got murdered at pretest — 2 can you help me debug it...please help..

        Spoiler
        • »
          »
          »
          »
          »
          4 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          I just want to know why, too. That's very hard for me to find reasons..

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

can someone tell me how f(4)=4 in problem D testcase 1??

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    No operation on 4

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      omg didnt think i cant make any opration problem is easy but didnt get that part :(

      • »
        »
        »
        »
        4 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        They did an announcement about that at 18:49

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Because you can choose $$$max(f(i), x)$$$ $$$= 4$$$, it's not necessary to do the operation, without doing the operation you will have $$$x=4$$$

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Zero operation is allowed.

»
4 months ago, # |
  Vote: I like it -14 Vote: I do not like it

Judging by the solve count, with the addition of one more hard problem this could've been a Div.1 + Div. 2 round.

»
4 months ago, # |
  Vote: I like it +6 Vote: I do not like it

almost 5k solution for D1. is it really that easy ?

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

278148861 was trying something unique for D2 , but had no time to debug :( . Solved 4 still gonnna get negative.

»
4 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

"You for participating!" was good

»
4 months ago, # |
  Vote: I like it +3 Vote: I do not like it

First time able to solve A-D in a div-2 contest

»
4 months ago, # |
  Vote: I like it +2 Vote: I do not like it

Spending more time for reading than coding. The description is too long, and I can't really understand what're the problems talking about. We should spend more time on thinking algorihms, not for reading.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone explain how D2 's first sample test

3 4 2 0 2 3 2 3 3 4 7 0 1 5

how is f(0)=3?

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

A really screwed me up as I didn't read that i<j.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

p013lPh7 didn't solve E1? bruh.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    sorry im dog, im indian dalit,in our country we cant study, im lowerclass , sorry my bad, i cant

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Couldn't figure out any algorithm for B, after a lot of observation just observed middle of sorted element happens to be answer in test cases.. donno how that worked! LOL

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    As Turtle wants to maximize the last value(remaining one),he will start by removing the smallest one in order to avoid small values.On the other hand Piggy wants to minimize the last value(remaining one),so he will start by removing largest one in order to avoid large values.Then after the process(Turtle always removes small values and Piggy always removes large values) ends,the remaining element will be definitely the middle one of sorted array.

»
4 months ago, # |
  Vote: I like it +9 Vote: I do not like it

C is my least favorite kind of problem, pretty easy to guess but much harder (imo) to prove a solution.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    What was the easy guess for C? What i guessed (and worked) didn't look very obvious and took me 1 hour.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      the guess is make adjacent elements different also took me 1 hr

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Frequency counter for letters, then append the letter with highest frequency to answer until you're out of letters.

      Code
    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Print alternating characters sorted by frequency descending...

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      i dunno i'm fast recognized what if i set same letters near each other, its minimize pairs

»
4 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

How do I approach D1?

  • »
    »
    4 months ago, # ^ |
    Rev. 2   Vote: I like it +19 Vote: I do not like it

    Hints for D1 and D2

    What is the first thing that we know about mex? Mex of $$$n$$$ integers is at most $$$n$$$. Therefore, if we were to perform at least one operation, $$$x$$$ can grow no longer than the maximum $$$n$$$ in the input. Therefore, the constraints $$$m \leq 10^9$$$ essentially means that $$$m \leq 2 \cdot 10^5$$$, since after this point, it's optimal to not do any operations on $$$x$$$.

    This gives us confidence to calculate the answer for each $$$f(i)$$$.

    Consider any list. What happens when you apply the operation on it. Remember that the $$$mex(L)$$$ is missing from this list, therefore, if you don't provide $$$mex(L)$$$, it'd still be missing. Hence, you can only get back $$$mex(L)$$$.

    But what if you do provide $$$mex(L)$$$ to fill in the gap? You'll get back the second missing element.

    Hence, a list can only improve your answer equal to the second missing element. Hence, the answer is the maximum of the second missing element from each list.

    But what if you are only allowed to use one list at most once. Then, you can think of it as a neural network, where the output of one layer is the input of the other layer. Then, create a directed graph where each list contributes on edge $$$m \rightarrow sm$$$, i.e, it is a neural network that takes in a missing element and outputs the second missing element.

    Notice that this would be a DAG since edges are from small to large. Then, define $$$indp[u]$$$ to be the max vertex reachable when you start at vertex $$$u$$$. Clearly, $$$indp[u] = max(indp[child])$$$.

    Also, define $$$outdp[u]$$$ to be the max vertex reachable when you don't start at $$$u$$$, However, using one operation, you can get the opportunity of starting at $$$u$$$, therefore, if there are more than one outdoing edge, then $$$outdp[u] = indp[u]$$$.

    Then, $$$f(u) = max(indp[u], outdp[*])$$$ where $$$*$$$ is everything except $$$u$$$.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Does this necessarily require graphs? Is there any way to solve it without graphs?

      • »
        »
        »
        »
        4 months ago, # ^ |
          Vote: I like it +5 Vote: I do not like it

        D1 doesn't require graphs, these hints involving graph are for D2.

        Technically D2 also doesn't require graphs, but it helps to visualize it if you are familiar with DAGs.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      ahhh, for D2 in the end i thought it could be solved with a graph, but i didnt have time to implement. thank you

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    for each sequence, u look what number u get after selecting 2 times that sequence, then after that u take the maximum, say it is Max, for every 'i' smaller than Max u get Max, otherwise u get 'i'. Then just do the count and print.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

For the 4th test case in E1, can't we make permutation: 6 5 8 7 4 1 3 2 with k1 = 2 and k2 = 6 total inversions = 22

»
4 months ago, # |
  Vote: I like it +7 Vote: I do not like it
»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

As a tester i want to know what the heck wrong did the turtle do to the problem setter

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Dumb me mistook the constraints for m as 2*10^5 in D1

»
4 months ago, # |
  Vote: I like it +9 Vote: I do not like it

My worst round ever despite solving a~d

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Could someone please explain to me the answer for the 4th test case for D1?

How is f(1) = 3?

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    1 -> 2 -> 3 Doing operation on third array twice

    • »
      »
      »
      4 months ago, # ^ |
      Rev. 3   Vote: I like it 0 Vote: I do not like it

      But there's only one array. The test case is:

      1 1

      7 1 2 4 1 4 9 5

      How can f(1) = 3? mex( 1 , 1, 2, 4, 1, 5, 9, 5) = 0

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Ok, I think I got it. First I'll get 1 to 0, then just apply the operation on 0 to get 3.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

In C how abc is not good?

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

In the problems section some of my solutions are marked red although they passed pretests. Is this because my solution is wrong or is it because testing still ongoing?

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

How did people even solve D1, and why was it 1000, also god damn did B and C piss me off once i realized the solution.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    its easy man, i mean its just the finding the second mex of every array and then finding the largest among the array of second MEX's. what fcked was int overflow lost 120 pts cuz of it :)

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I believe the first test case already had overflow in it

      • »
        »
        »
        »
        4 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Exactly what i thought. But if you will look at my submitted solutions , the first and the third are the exact same but first fails on tc3 and third one accepted cuz I literally changed everything to long long :)

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Omg, now i feel dumb, why did i forget that you can store 2 mex's lmfao

»
4 months ago, # |
  Vote: I like it -9 Vote: I do not like it

I submitted problem D1 first in C++23 and did not pass (for 3 times).

Then I changed the language to C++20 and it passed.

Why? MikeMirzayanov please fix it!

I lost 150 points in the contest because of this new language.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    https://codeforces.net/blog/entry/133046

    Please note that support for GNU G++23 14.2 (64 bit, msys2) is currently experimental. We invite you to join in the testing and experimentation process. Share your thoughts and experiences in the comments!

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      So? Does that mean I deserve to lose points? If there are problems or bugs, shouldn’t the admin fix them and try to make the platform better?

      Experimental doesn’t mean that participants using it will fail passing, it just means it’s not perfect enough. We should find the bugs and report them to make it better.

      • »
        »
        »
        »
        4 months ago, # ^ |
          Vote: I like it +1 Vote: I do not like it

        It means that g++23 has just been implemented on Codeforces and that it is as you said, not perfect enough. They warned you that it is experimental. Of course, it is not completely your fault and I don't blame you.

      • »
        »
        »
        »
        4 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Reading is your issue, not Mike's. they clearly said to not use it during contest

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    There is probably an undefined behavior somewhere in your code, have you thought about it?

»
4 months ago, # |
  Vote: I like it +10 Vote: I do not like it

B is really cute

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Please Help: If i lock my answer late does it take the late locking or the time of submission.Also if i do incorrect submissions on problems i didnt solve do i take peantly or no?

»
4 months ago, # |
  Vote: I like it +4 Vote: I do not like it

truly disgusting abc, simply cannot imagine any worse

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Worst Contest Ever (for A to D1)

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone explain why f(3)=4 for second sample test of D1?

3 4 5 0 2 0 4 11 1 1 5 1 3 0 3 3

  • »
    »
    4 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    You can use this sequence: 5 1 3 0 3 3 two times. First time it changes mex to 2 and again using it will make mex 4.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    By doing the operation on third array twice : 3->2->4

»
4 months ago, # |
  Vote: I like it +101 Vote: I do not like it

codeforces announcement

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Guessforces... But I love guessing :)

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    not when you are trying really hard to become pupil though

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Sorry zltzlt, problems are just guesswork. Not a good round.

  • »
    »
    4 months ago, # ^ |
    Rev. 2   Vote: I like it -17 Vote: I do not like it

    nvm

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it +5 Vote: I do not like it

      How is it guessing if all of the problems you mentioned are easily provable?

      • »
        »
        »
        »
        4 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Easy proof for C?

        • »
          »
          »
          »
          »
          4 months ago, # ^ |
          Rev. 3   Vote: I like it 0 Vote: I do not like it

          No matter how you rearrange the string, you can't change the number of pairs where $$$s_i = s_j$$$, so you focus on the pleasant pairs where $$$s_i \neq s_j$$$. So yo want to maximise the number of substrings of the form x...y...z, where x, y and z are pairwise distinct characters. One construction that achieves that is the alternating characters one since you don't benefit from having two equal adjacent characters.

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      D is not guessing lmao

»
4 months ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

For problem D1, can we just find the max among the second mexes of all the sequences and then for each i from 0 to m, find f(i) = max(max among all second mexes, i) and then we just add all the f(i) ? I am not sure if the time constraint will allow this approach. Wasn't able to write the code in time :/ .

  • »
    »
    4 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    Yes, that is how I solved it. You don't have to iterate all the way to m, you can just do this:

    if (m <= mx) {
        cout << mx*(m + 1) << endl;
    }
    else {
        cout << mx*(mx + 1) + m*(m + 1)/2 - mx*(mx + 1)/2 << endl;
    }
    
    • »
      »
      »
      4 months ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      Thanks, I was just wondering whether the brute soln works or not.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

To solve D1, you must get the largest "second mex" (the mex if an array included the initial mex) of all sequences. Then just iterate from i=0 to i=m and add max(second_mex, i). I forgot to take max of i as well :(

Am I correct?

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I solved D2 exactly at the end of the contest, time to kms :).

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    any hints for D2 or it was same as D1!!!

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Hints

      1
      2
    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      just create a directed graph between the first and second mex in each sequence. and after traversing through any path, its end is the maximum value you can get. that's it, you need to handle some cases as well and try to do this effeciently

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone explain solution for D in russian, please. I didn't understand the part with formulas

»
4 months ago, # |
  Vote: I like it +9 Vote: I do not like it

no proofs .. only hope

»
4 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Hey guys, I came up with a special idea for C during the contest and it's too easy to implement -

Just sort the string, and print the string in an order like $$$1,n,2,n-1,3,n-2,\dots$$$, and that's all.

Can anyone prove it?

»
4 months ago, # |
  Vote: I like it +8 Vote: I do not like it

why so much guesswork nowadays?

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    seriously .These days div2 contests are rubbish and just absurd

»
4 months ago, # |
  Vote: I like it +16 Vote: I do not like it

great problem D.

nice problem set

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I'm curious about how the checker was written for problem C

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    they probably count the number of good pairs in their answer, and count the number of good pairs in your answer and compare

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yes and I'm wondering how that counting process works efficiently

»
4 months ago, # |
Rev. 3   Vote: I like it +6 Vote: I do not like it

watch out for leaked solutions in today's contest, hope the ones who cheated get plagiarized!:)

C: 278153815

D1: 278154032

D2: 278155020

C: https://codeforces.net/contest/2003/submission/278154255

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

The contest was beautiful, but it became unfair due to cases of fraud and checking the security of the connection, which caused a huge delay. I hope this situation will be avoided. I did not provide a solution for more than 15 minutes due to verification

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

today i gave this contest it was my first contest and i was not able to solve any problem and friends did solve first 2 problems i usually do leetcode and i am able to solve leetcode medium with not that much difficult any suggestions on how to improve and able to attempt problmes

  • »
    »
    4 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    Leetcode problems are very different from Codeforces problems. I assume you are decent at Leetcode problems because you started out with easy ones, then a bit harder, etc. For Codeforces, you can start with Div 4 problems if you are still struggling, then to Div 3, etc. You can use something like CFtracker to find problems of your difficulty.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Has already been system testing?

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yep. And the ratings have already been updated.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

For D1, the solution seems to work for small numbers, but deviates a little from the answer for large numbers. Is the logic wrong or it has to do something with long long type in c++?

Submission link

Thanks

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

When do the ratings get updated?

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I am on 1199 will they update the ratings afterwards if they find some people have cheated or something?

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    sometimes

    • »
      »
      »
      4 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Man i don't wanna go down from here, i doubt i will find a easier/guessable div 2

      • »
        »
        »
        »
        4 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        You wont go down you most likely will increase.

        • »
          »
          »
          »
          »
          4 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          i mean i wanted to cross 1200 once, who know's what will happen in the next contests

          • »
            »
            »
            »
            »
            »
            4 months ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            Don't worry there is an upcoming division 3 if you preform well you'll break the 1200 barrier

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    yes. but the rollback could happen in like a month, or in a day. they're really random with the rollbacks

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Thank you

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Wow, I got question A right by luck. I compared the first and last indices of the string and submitted it after all the pre-test cases passed. Then I reread the problem and thought that multiple substrings could be made starting from index 2, each of length 2 (k >= 2). I compared index 0 to every even index and the last index, but the test failed. I thought, "Yep, still too dumb—0 questions solved in this contest, lol." But it worked!

a question people ,how to read/understand the question better ?

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    One thing that you should keep in your head when solving A, B, C is that the problem cannot be very hard. A, B should be easy. But they can be obfuscated a bit.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

can someone help me with problem D2, here's my submission : https://codeforces.net/contest/2003/submission/278173730 i have tried it for a lot of time, but cant figure out why there is mle, is my code doing something wrong (like something could be taking a lot of memory, its space complexity is more than that i can take in question) or its something else. Can someone please help?

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Became Pupil.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

bro the gap from b to c

»
4 months ago, # |
  Vote: I like it +3 Vote: I do not like it

The absolute difficulty level of B and C is much greater, and it could only be realised while you try to prove the correct solution.

»
4 months ago, # |
Rev. 2   Vote: I like it +11 Vote: I do not like it

After solving A,B
Stuck at C and go to D
Rating very bad.
Finally solve A B C D1 D2
Become expert again!

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Could someone help me with D2 please? 278259567

IDK why it fails on test case 26, did all the optimisations that I could.

»
4 months ago, # |
  Vote: I like it -9 Vote: I do not like it

I encourage authors and coordinators to use $$$5000$$$ instead of $$$5\cdot 10^3$$$, the second one can be easily confused with $$$3\cdot 10^5$$$.

  • »
    »
    4 months ago, # ^ |
      Vote: I like it -7 Vote: I do not like it

    You are complaining about using scientific notation?? If anything, people should use scientific notation more. I dont usually blame my inability to read on authors, why do you?

    • »
      »
      »
      4 months ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      I'm not complaining just suggesting, from my point of view is better using scientific notation only for big numbers not small ones. Note that $$$5000$$$ is shorter than $$$5\cdot 10^3$$$, and scientific notation should be practical, not a fancy thing for those who believe that are better than others. You can write $$$20$$$ as $$$2\cdot 10$$$. Also if you can help contestants in the way I think is the best choice. I strongly disapproves those who thinks that readying and understanding what author mean to say is a problem solving ability. You(I mean authors in general) should make statements as clear and readable as possible

      • »
        »
        »
        »
        4 months ago, # ^ |
          Vote: I like it -8 Vote: I do not like it

        I agree with all of your points that 20 should indeed not be 2 . 10

        However, at 5000, its a judgement call, you cant blame authors for a coin flip. I think both are fine at 5000.

        • »
          »
          »
          »
          »
          4 months ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          I'm not blaming just suggesting, I perfectly know is my fault if I misread something, and I can absolutely not blame authors about that. But I really think $$$5000$$$ it's ok because is small and if you help contestants to better understanding why not? I'm pretty sure I'm not the only one who got confused with this before. My point is that using $$$5000$$$ instead of $$$5\cdot 10^3$$$ can help people and only hurts those who believe that using scientific notation make them more intelligent

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

%%% zlt round

»
4 months ago, # |
  Vote: I like it -10 Vote: I do not like it

I recently received an email stating that my solution for the C problem in the contest coincides with those of other participants. I want to assure you that I have not engaged in any form of cheating or plagiarism.

I have been working diligently on this contest, and any similarities in the solution are purely coincidental. I am confident that a review of my older submissions will demonstrate my commitment to solving problems independently and with integrity.

Please feel free to reach out if you need any further information or clarification. I am more than willing to cooperate in any way necessary to resolve this matter.

Thank you for your understanding and attention to this issue.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Hello codeforces, my solution got skipped. I knew i would get skipped because i used this account for looking at my friends results from friends standings. And i participated in the contest from the other account ( the one which my solution is same with ). You can see that i only submitted 1 problem with this account, which has to be a mistake. Both of the accounts have same exact password. Overall, i didn't cheat...

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Hello Codeforces, My solution of the C problem of this contest is skipped and I got a mail that it is matching with some other users. I want to assure you that I had written the code myself and didn't cheated anyway. I used the map for storing frequency and the code that I had written to traverse and delete at the same time, its the only way to do that. How can be my code skipped if I used common variable names eg. ans, mp, it. I always use these variable names. Overall, I want to say that I was not involved in any type of cheating and my solution shouldn't be skipped. Please re-check my solution.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Difficulty estimates (of problems I was able to solve).

A — 800

B — 900

C — 1400

D1 — 1500

D2 — 2100

»
4 months ago, # |
Rev. 3   Vote: I like it +4 Vote: I do not like it

Subject: Request for Review of Penalty on Question 4 — Codeforces Round 968 Div2

Dear Codeforces Team,

I hope this message finds you well. I am writing to request a review of the penalty imposed on my submission for Question 4 in Codeforces Round 968 Div2.

During the contest, I successfully completed the first three questions within 32 minutes. For the fourth question, I made observations and developed the correct logic, submitting my initial solution at 1 hour 4 minutes into the contest. However, due to a minor mistake in my approach to finding the second MEX, I continued working on the problem and submitted a revised solution at 1 hour 55 minutes.

Initially, I used a map to find the second MEX, but I encountered an issue due to a variable being incorrectly placed. To resolve this, I switched my approach and utilized a set to determine the second MEX. My approach was informed by the blog post available at this link https://cp-algorithms.com/sequences/mex.html .

I have received a notification regarding a potential violation related to my submission for Question 4. I believe the penalty might be due to the changes in my approach between submissions. I assure you that the changes were made independently as part of my problem-solving process during the contest.

I kindly request that you review my profile and uplift the penalty, as I believe this was a genuine effort to correct my solution rather than a violation of the contest rules.

Thank you for your understanding and consideration.

Best regards, KraitOPP

Mention cz_yxx Hosen_ba farkon00 _minhduccp Empty_Dust MikeMirzayanov

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Why My Rating Not changes after solving A B C in This contest I got Mail regarding Plagarism Which I did't understand may be it was a coincidence. please reply

  • »
    »
    4 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I uses map and priority queue and basic implementation why I my all three A B C problems skipped?

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

can someone please tell me rating of these questions....and how to know rating of contest questions

  • »
    »
    4 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    the rating of question on codeforces will be updated after a few weeks (usually 3-4 weeks). Or this for quicker estimation. Of course those rating is just estimation... solve problem that you like is always the best.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

What a nice round! Orz zlt%%%%

»
4 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Attention!

Your solution 278111056 for the problem 2003B significantly coincides with solutions hydr0gen_per0xide/278110807, ankushmondal1y2t/278111056. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.net/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

what is this can't i give contest with 2 accounts ?? both are my solutions I didn't know its illiegal (then Iam sorry for that ) if it is then i will give contest by one accounts and is my account is blocked ?? will I able to get it back??

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

傻逼场