zltzlt's blog

By zltzlt, history, 20 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

| Write comment?
»
20 months ago, hide # |
 
Vote: I like it +27 Vote: I do not like it

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

»
20 months ago, hide # |
 
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!

»
20 months ago, hide # |
 
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!

»
20 months ago, hide # |
 
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."

»
20 months ago, hide # |
 
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!

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

As a tester, GL&HF

»
20 months ago, hide # |
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

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

hoping to not reach green after this one

»
20 months ago, hide # |
 
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!

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

You

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

Wow,CN Round!

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

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

I'm a tester?! /jy

»
20 months ago, hide # |
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.

  • »
    »
    20 months ago, hide # ^ |
     
    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

  • »
    »
    20 months ago, hide # ^ |
    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.

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

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

»
20 months ago, hide # |
 
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)

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

Hoping to get just 1 more rating

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

Time to Ctrl+Z my sanity and dive in!

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

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

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

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

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

Best Wishes!

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

i like tacos

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

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

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

8 problems!

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

Good luck to all participants!

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

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

hope back to expert:)

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

Best of luck to all of you

»
20 months ago, hide # |
 
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.

  • »
    »
    20 months ago, hide # ^ |
     
    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.

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

      see this question "https://mirror.codeforces.com/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.

      • »
        »
        »
        »
        20 months ago, hide # ^ |
         
        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.

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

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

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

hope you all get +delta this time

»
20 months ago, hide # |
 
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

  • »
    »
    20 months ago, hide # ^ |
     
    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.

  • »
    »
    20 months ago, hide # ^ |
     
    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

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

mathforces incoming

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

Hope for Salah7_a

»
20 months ago, hide # |
 
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 :(

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

Never been cooked this bad :(

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

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

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

aryanc403 beat rainboy today :)

  • »
    »
    20 months ago, hide # ^ |
    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.

    • »
      »
      »
      20 months ago, hide # ^ |
       
      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 :)

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

GuessForces

»
20 months ago, hide # |
 
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

  • »
    »
    20 months ago, hide # ^ |
    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.

  • »
    »
    20 months ago, hide # ^ |
     
    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.

  • »
    »
    20 months ago, hide # ^ |
    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)

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

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

  • »
    »
    20 months ago, hide # ^ |
     
    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.

    • »
      »
      »
      20 months ago, hide # ^ |
       
      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.

  • »
    »
    20 months ago, hide # ^ |
     
    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;
    
  • »
    »
    20 months ago, hide # ^ |
     
    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.

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

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

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

        can you help me debug it...

        Spoiler
    • »
      »
      »
      20 months ago, hide # ^ |
       
      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

    • »
      »
      »
      20 months ago, hide # ^ |
       
      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}$$$

      • »
        »
        »
        »
        20 months ago, hide # ^ |
         
        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
»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    20 months ago, hide # ^ |
     
    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$$$

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

    Zero operation is allowed.

»
20 months ago, hide # |
 
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.

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

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

»
20 months ago, hide # |
 
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.

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

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

»
20 months ago, hide # |
 
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.

»
20 months ago, hide # |
 
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?

»
20 months ago, hide # |
 
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.

  • »
    »
    20 months ago, hide # ^ |
     
    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.

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

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

    • »
      »
      »
      20 months ago, hide # ^ |
       
      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
    • »
      »
      »
      20 months ago, hide # ^ |
       
      Vote: I like it +1 Vote: I do not like it

      Print alternating characters sorted by frequency descending...

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

How do I approach D1?

  • »
    »
    20 months ago, hide # ^ |
    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$$$.

    • »
      »
      »
      20 months ago, hide # ^ |
       
      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?

      • »
        »
        »
        »
        20 months ago, hide # ^ |
         
        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.

    • »
      »
      »
      20 months ago, hide # ^ |
       
      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

  • »
    »
    20 months ago, hide # ^ |
     
    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.

»
20 months ago, hide # |
 
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

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

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

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

My worst round ever despite solving a~d

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

In C how abc is not good?

»
20 months ago, hide # |
 
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.

  • »
    »
    20 months ago, hide # ^ |
     
    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 :)

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

      I believe the first test case already had overflow in it

      • »
        »
        »
        »
        20 months ago, hide # ^ |
         
        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 :)

»
20 months ago, hide # |
 
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.

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

    https://mirror.codeforces.com/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!

    • »
      »
      »
      20 months ago, hide # ^ |
       
      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.

      • »
        »
        »
        »
        20 months ago, hide # ^ |
         
        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.

      • »
        »
        »
        »
        20 months ago, hide # ^ |
         
        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

  • »
    »
    20 months ago, hide # ^ |
     
    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?

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

B is really cute

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

truly disgusting abc, simply cannot imagine any worse

»
20 months ago, hide # |
 
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

  • »
    »
    20 months ago, hide # ^ |
    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.

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

codeforces announcement

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

Guessforces... But I love guessing :)

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

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

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

    nvm

    • »
      »
      »
      20 months ago, hide # ^ |
       
      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?

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

        Easy proof for C?

        • »
          »
          »
          »
          »
          20 months ago, hide # ^ |
          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.

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

      D is not guessing lmao

»
20 months ago, hide # |
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 :/ .

  • »
    »
    20 months ago, hide # ^ |
    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;
    }
    
»
20 months ago, hide # |
 
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?

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

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

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

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

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

      Hints

      1
      2
    • »
      »
      »
      20 months ago, hide # ^ |
       
      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

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

no proofs .. only hope

»
20 months ago, hide # |
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?

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

why so much guesswork nowadays?

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

great problem D.

nice problem set

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

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

»
20 months ago, hide # |
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://mirror.codeforces.com/contest/2003/submission/278154255

»
20 months ago, hide # |
 
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

»
20 months ago, hide # |
 
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

  • »
    »
    20 months ago, hide # ^ |
     
    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.

»
20 months ago, hide # |
 
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?

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

can someone help me with problem D2, here's my submission : https://mirror.codeforces.com/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?

»
20 months ago, hide # |
 
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.

»
20 months ago, hide # |
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!

»
20 months ago, hide # |
 
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$$$.

  • »
    »
    20 months ago, hide # ^ |
     
    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?

    • »
      »
      »
      20 months ago, hide # ^ |
      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

      • »
        »
        »
        »
        20 months ago, hide # ^ |
         
        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.

        • »
          »
          »
          »
          »
          20 months ago, hide # ^ |
          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

»
20 months ago, hide # |
 
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.

»
20 months ago, hide # |
 
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

»
20 months ago, hide # |
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

»
20 months ago, hide # |
 
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

  • »
    »
    20 months ago, hide # ^ |
    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.

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

What a nice round! Orz zlt%%%%

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

傻逼场