awoo's blog

By awoo, history, 10 days ago, translation, In English

Neapolis University Pafos

Hello Codeforces!

The series of Educational Rounds continues thanks to the support of the Neapolis University Pafos. They offer a BSc in Computer Science and AI with JetBrains Scholarships. Gain cutting-edge skills in AI and machine learning, preparing you for high-demand tech careers. Curious? Check out the CSAI curriculum now. Limited scholarships available — don't miss your chance to study in Europe for free!

On Aug/15/2024 17:35 (Moscow time) Educational Codeforces Round 169 (Rated for Div. 2) will start.

This round will be rated for the participants with rating lower than 2100. It will be held on extended ICPC rules. The penalty for each incorrect submission until the submission with a full solution is 10 minutes. After the end of the contest, you will have 12 hours to hack any solution you want. You will have access to copy any solution and test it locally.

You will be given 6 or 7 problems and 2 hours to solve them.

The problems were invented and prepared by Adilbek adedalic Dalabaev, Ivan BledDest Androsov, Maksim Neon Mescheryakov and me. Also, huge thanks to Mike MikeMirzayanov Mirzayanov for great systems Polygon and Codeforces.

Good luck to all the participants!

UPD: Editorial is out

  • Vote: I like it
  • +95
  • Vote: I do not like it

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Hope to reach candidate Pupil after this one

»
9 days ago, # |
  Vote: I like it +2 Vote: I do not like it
»
9 days ago, # |
  Vote: I like it -41 Vote: I do not like it

Please share the problem ratings.

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

hopefully expert after this one

  • »
    »
    9 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    good luck mate

  • »
    »
    9 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    good luck

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

    why is this comment at -12???

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

      idk either lmao, it is what it is

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      because this is cf

    • »
      »
      »
      7 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      coz he's probably a cheater,see his submissions

      • »
        »
        »
        »
        7 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        if you accuse me of cheating, I suppose you have evidence?

        • »
          »
          »
          »
          »
          7 days ago, # ^ |
          Rev. 3   Vote: I like it -17 Vote: I do not like it

          .

          • »
            »
            »
            »
            »
            »
            7 days ago, # ^ |
              Vote: I like it +9 Vote: I do not like it

            Look through every single one of my submissions, and you can see I ALWAYS write long long int. Any single time I use 64-bit integer, I always type long long int. You just picked a random submission and the most random reason and decided to go with it? cope and seethe newbie, maybe focus on actually solving some problems instead of throwing baseless accusations.

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

              So maybe you debug every question using ai,who knows!Also I am actually pupil,I didn't know multiple accounts are not allowed on cf,Hence kept this one only for practicing.

              • »
                »
                »
                »
                »
                »
                »
                »
                7 days ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it

                yea sure, I also use ai to type my code when I practice as well right? you're a complete clown, stop embarrassing yourself. oh and since when is AI considered cheating?

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

            I used to write long long int every time myself before I started using a template that had long long. "clearly ai generated" bro is confident too. maybe try to come up with better proofs next time, at the very least you could avoid so many wrong submissions Starting to blame everyone you see for cheating using such petty claims is making things worse

»
9 days ago, # |
Rev. 2   Vote: I like it +6 Vote: I do not like it

Independence day Contest !

»
9 days ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

All the best to all. Hope you all get +100.

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

How to gain rating in EDU Round? I've droped the rating at almost every the EDU round.

»
9 days ago, # |
  Vote: I like it +3 Vote: I do not like it

I'm glad that there are no tester comments.

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

i love edu rounds <3

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Pupil rank happens TOMORROW

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Looking forward to weeks of therapy for failing to do C over my misinterpretation of what the k variable meant...

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

How to Hack someone's solution?? Shayan bro i think you should make a video on this topic!! I tried many times to hack someone.. but always ( Unsuccessful Attempt )

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

    You should give test with high strength. Here is an example: 274841071

    https://codeforces.com/contest/1999/hacks/1066931

    If you can't understand this code, it doesn't matter. You just need to know what he is doing. In this code, he's using Substring all the times which is $$$O(|s|)$$$ in time. It will get a TLE by a test with high strength. Thus, I give a test like this: 1, and then 200000 ?s, and then an a.

    Unaccidentally, he is hacked by me.

    • »
      »
      »
      9 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      You just used generator to generate worst case for s right?? But how did you figure out it'll give TLE..

      How to practice for this?? I am very bad to figure out the time and space complexities

      • »
        »
        »
        »
        9 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        You can search the submissions in “Status”. And sort it by execution time at the end of the page. And get to the last page. The submissions there are almost TLE so that maybe TLE after you hack them.

        • »
          »
          »
          »
          »
          9 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          What generator do you use?

          • »
            »
            »
            »
            »
            »
            9 days ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            Usually I use C++’s output. You can use what you familiar with.

            if the test isn’t that long, just input the test by text is enough.

            • »
              »
              »
              »
              »
              »
              »
              9 days ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              There you've wrote string s of length 2*10^5, how did you do that, and how to generate those big test cases?

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

                There is a “Generate Input” Botton when you hack. Press it and paste your code there.

                Example:

                #include<bits/stdc++.h>
                using namespace std;
                int main(){
                
                    cout<<“1\n”;
                    for(int i=0;i<=200000;i++)                 cout<<“?”;
                    cout<<endl<<“a\n”;
                }
                
                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  9 days ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  Okay, this way! Thanks.

        • »
          »
          »
          »
          »
          9 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          I tried this multiple times but never got successful Attempt

          • »
            »
            »
            »
            »
            »
            9 days ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            Try more, you’ll gain from it.

      • »
        »
        »
        »
        9 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        What’s more , see which problem is hacked most. It may mean that it is easier to hack than other problem.

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

Sorry I’m a beginner here, how are edu rounds different from normal contests ?

PS: Got it, thank you!

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

    The difficulty level is usually the middle ground of div2 and div3 constests.

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

    You can't hack during the contest, but you can EVERYONE hack after contest.

    • »
      »
      »
      9 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I am a total beginner and have no idea what hacking means in this context. Like changing the answer or sth? Where should I start from

      • »
        »
        »
        »
        9 days ago, # ^ |
          Vote: I like it +5 Vote: I do not like it
      • »
        »
        »
        »
        9 days ago, # ^ |
        Rev. 5   Vote: I like it 0 Vote: I do not like it

        In some contests like Div. 2 Round, there is a Codeforces Format .

        Maybe in most websites, it will give you the result at once when you submit. But if Codeforces, there is only a set of tests called Pretests.

        It just means that this is just the preliminary test which shows you if the code can run normally. If you passed pretests, you can lock this problem and hack participants who pasts pretests in your room, by giving tests with high strength to make them failed passing this problem.

        P.S. If you lock the problem, you can't resubmit any more until the contest ends.

        To get more information, you can read this blog

        https://codeforces.com/blog/entry/456

        In Div. 3 , Div. 4, and EDU Round, it is EX-ICPC Format. There will be a 12-hour-long phase at which you can hack everyone after the contest.

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

    Different from Div.1 , Div.2 , Div.1+2 contests, it is an EX-ICPC Format.

    Similar to Div.3 and Div.4 contests. You can see participants rated and unrated separately in the standings after system testing. You can view last Div.3 contest as an example: Codeforces Round 966 (Div. 3)

    And view this round to see the probable difficulty of each problem. Educational Codeforces Round 168 (Rated for Div. 2)

    standings: View rated participants rated separately by pressing the Both divisions v botton at the rightmost of your screen. Then cancel the tick of Show unofficial one.

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Thanks to all who contributes to this contest. Hope I can go back to specialist after this one!

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Hope for 1300+ rating

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Let's go specialist in this one

»
9 days ago, # |
  Vote: I like it +1 Vote: I do not like it

My first contest as specialist. Good luck everyone.

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Best of luck to all. Hopefully, we will increase our rating in this contest =)

»
9 days ago, # |
  Vote: I like it +15 Vote: I do not like it

Bet it or not, I'm going to reach Master this round.

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

    Good luck to you. Good luck to everyone.

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Not happening, ahahaha

    • »
      »
      »
      8 days ago, # ^ |
      Rev. 3   Vote: I like it +9 Vote: I do not like it

      I didn't say I bet it. haha.... ha... Failure is common.

      Nevermind. I'll be still there next round.

      How can you reply me just minutes before the contest, are you watching me? Thank you for your watching stuttering

      Maybe I'm going to change my handle into Lmao_Fox if this happens too many times.

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

best of luck guys

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I want to regain my pupil status.

»
9 days ago, # |
  Vote: I like it +40 Vote: I do not like it

If I don’t get CM I’m gay.

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

    Congratulations! At least it's legal in Singapore since recently.

  • »
    »
    7 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    nice way of coming out of the closet

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

hope i become pupil , pls be easy for me

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Hoping for a positive delta!

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

In Educational Round dose speed of solving question matters or only number of questions solved during the contest matters and does not depend even on the rating of the question solved??

  • »
    »
    9 days ago, # ^ |
    Rev. 2   Vote: I like it +5 Vote: I do not like it

    Speed matters. Rank is sorted first by number of solved problems, then time (10 minutes penalty for 1 wrong submission)

    That means solving A and solving G are the same. It just calculates the total number of your solved problems and then the time.

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

InShaAllah, I will get +100 today

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I also prayed to Allah to make me capable of solving at least 4 problems but i guess it wasn't better for me

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Hope to solve four problems!

»
8 days ago, # |
  Vote: I like it +2 Vote: I do not like it

c < b

»
8 days ago, # |
  Vote: I like it -13 Vote: I do not like it

worst contest((

»
8 days ago, # |
Rev. 2   Vote: I like it +26 Vote: I do not like it

Great D but C < B.

»
8 days ago, # |
Rev. 2   Vote: I like it +60 Vote: I do not like it

so what the hell are you supposed to do for E (nims and games are kinda like the opposite of my skillset lol)

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Find grundy numbers using SPF.

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

    I don't know why it was named "not a nim problem". I solved it as a nim problem. Case analysis on small numbers showed that the nimber of a pile is basically the "rank" of its smallest prime factor (where a prime having rank k means it's the kth prime number, except that the rank of 2 is 0.)

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

Video editorial for D: Colored Portals

Here's a very fancy implementation of D: Colored Portals using Bitmask tricks that was introduced in D: Cases from a recent CF round. I also have a video editorial for the old problem.

Let's represent all portals as bitmasks of length 4. Then, a path between 2 nodes is possible if and only if the bitwise AND of both the numbers is not zero.

Assume $$$x < y$$$. On a number line, we know that the shortest path between 2 points is the straight line connecting them. So, if $$$a[x] \& a[y] \neq 0$$$, then, the answer is $$$|x - y|$$$. Otherwise, we need to jump to a portal that differs in exactly one color (i,e, the bitwise AND should contain exactly 1 set bit). From there, we can jump to $$$y$$$ directly.

Define $$$ldp[i]$$$ to be the nearest portal to the left that differs in exactly one color. You can populate it from left to right by maintaining a map of the latest bitmasks seen so far. Similarly, you can populate $$$rdp$$$.

There are only 3 possible paths. We take the best one amongst them.

  • $$$x \rightarrow y$$$
  • $$$x \rightarrow ldp[x] \rightarrow y$$$
  • $$$x \rightarrow rdp[x] \rightarrow y$$$
  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i got the solution down immediately, but i could not implement it at all, fk me

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I also got the solution, but my implement is not as good as the method above so... I don't know where I went wrong (I use binary search btw)

      • »
        »
        »
        »
        8 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        i tried using a map and then i also tried bs and some other stuff and i just couldnt get it. unlucky :(

        • »
          »
          »
          »
          »
          8 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          276681877

          You can look at my case work. I am laughing at my own code.

        • »
          »
          »
          »
          »
          8 days ago, # ^ |
          Rev. 6   Vote: I like it 0 Vote: I do not like it

          oh well I notice where I went wrong, need to reverse the array and position to binary search to get the correct answer. Not searching the y+1 or x+1 or (x+y)//2 will do

          UPD: after fix the bs bug, my solution got TLE in test 6

          In the hindsight, just maintain ldp and rdp will do me a favor more than bs

          UPD: Resolved TLE, it's list.insert(0, list) which I think O(1) but it's O(n)

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

And the trend of 4k+ solves on D in Edu Rounds continues...

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

whoops

»
8 days ago, # |
  Vote: I like it +170 Vote: I do not like it

Why would you ever call a nim problem — $$$\texttt{Not a Nim Problem}$$$

Like I really don't understand, because it is funny?

When I read the name, I though that it is a bad idea to include "Nim" in the name of the problem, because when you search for nim tasks, this one would show up.

When though of the solution, I became even more confused. It was a nim problem. So why the author is telling me it is not true?

I thought that the name was part of the statement. I started to doubt myself that I got something wrong. Turns out everything is fine, nim works. Downvoted the contest when I saw "Accepted" verdict.

And also this statement:

  • It is not allowed to take from the pile a number of stones y such that the greatest common divisor of $$$x$$$ and $$$y$$$ is not equal to $$$1$$$.

Why you say "not not A" instead of just " A "

We can rewrite it like this:

  • It is only allowed to take from the pile a number of stones y such that the greatest common divisor of $$$x$$$ and $$$y$$$ is equal to $$$1$$$.

This sentence is so confusing that even an announcement was made, where it was stated that

  • In other words, gcd(x,y) must be 1.

If it is so confusing, maybe the statement should be fixed? I don't understand why the announcement was made, and this sentence was not changed.

»
8 days ago, # |
  Vote: I like it +1 Vote: I do not like it

Every page from problem to submit takes so much time to load. It's infuriating.

»
8 days ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it
ARE THESE GRUNDY NUMBERS CORRECT ?
  • »
    »
    8 days ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Yes

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I could generate grundy numbers, but didn't know how to extend them to 10^7. Small hint please ?

  • »
    »
    8 days ago, # ^ |
    Rev. 3   Vote: I like it +38 Vote: I do not like it

    For even numbers, grundy is always 0. For 2, it is obvious because you can only take 1 and the grundy of 1 is 1. For the rest, because player is not allowed to take 2, then $$$g(2)=0$$$ would always be the mex of all options

    For prime numbers, the grundy is $$$k$$$ where $$$k$$$ is the order of prime numbers (e.g. $$$g(3) = 2$$$, $$$g(5) = 3$$$ etc). This is because all prime numbers $$$p$$$ can have options of $$$1,2,3,\ldots,p-1$$$. Therefore the mex is always $$$k$$$ because it hasn't existed yet

    For the rest, the grundy would be smallest prime factor of that number. Because it would be the smallest number that doesn't exist for all its transition (hence, it similar to the nature of mex). The other number would exist because if the smallest prime factor is $$$p$$$, then all numbers between $$$1, 2, \ldots, p-1$$$ can be taken of that pile. Hence, all numbers between $$$0, 1, 2, \ldots, g(p-1)$$$ can be exist as transition moves and won't appear as mex.

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

      Thank you very much for explanation.

      I could see the first and second observations from the brute-force that I had written.

      But I couldn't deduce the third observation :( . otherwise I would have solved this.

      Anyone who is interested in how to generate grundy numbers here, please refer to this.

      c++ code to generate grundy number
      • »
        »
        »
        »
        8 days ago, # ^ |
          Vote: I like it +6 Vote: I do not like it

        Don't worry it took me 90 minutes to get it haha. F was much more straightforward today, so it's a good thing I wasn't afraid to skip.

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      small doubt, can we generate all the primes till 10^7 within the given time-limit ? ( never generated primes till 10^7, so asking ).

      We need to find the what is the order of the given prime number, and we can't do that unless we have all the prime numbers within 10^7.

      Do we need to implement SegmentedSieve ? or normal sieve is sufficient ?

      fonmagnus

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

        I think if we skip the even numbers, then we can do it for $$$5 \times 10^6$$$ numbers and should be fine (it's kinda close to TL but I guess that's one way to prune it)

        • »
          »
          »
          »
          »
          8 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Sure, will try later.

          I wish, the pile sizes were within 10^5 range.

          then I would have solved this question in 25-30 minutes :P .

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

        yes we can. my submission ran in 406ms and i am running sieve till 1e7

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

        can we generate all the prime still $$$10^7$$$ within the given time-limit?

        yes, use linear sieve

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

        Normal sieve, if implemented correctly, runs in O(n*log(log(n))), which is sufficient (my sol passed with it).

»
8 days ago, # |
  Vote: I like it +68 Vote: I do not like it

Don't use " NOT NOT " in your statements ever again please

And yes, I googled E, sue me (I suspect many others did or have seen this problem before anyway)

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    This makes me wonder how many people thought of E during the contest by themselves instead of just googling. Because I couldn't think of anything after more than an hour (sad noises**)

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

      I have spent most of the time going back and forth: "This is coprime nim. No, this isn't coprime nim. What if I take only divisors? But I can take any non coprime number. Wait, this is coprime nim, gcd should be equal to 1"

      In regards to coprime nim (and not divisor nim, non-coprime nim and other variations) I've come up only with the most obvious stuff on my own:

      • 0 is losing, 1 is wining and even numbers are always losing (since you are always forced to reduce the pile to some odd number, and from and odd number you can always go back to an even one)
      • for a prime number any move except for the number itself is possible
»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

D is maybe just next and previous tables but in order for me to implement it I would need maybe 400 line looking forward to see how people did it nicely

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I'm curious if E is a classic problem of SG function. I don't know how to do it, but I have a vague feeling that it can do it.

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    what is SG function?

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

      Sprague-Grundy function, super useful for nim-like problems.

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Consider treating the game process as a DAG, taking the SG function value of a node as the mex of the SG function values of its child nodes.

  • »
    »
    8 days ago, # ^ |
    Rev. 3   Vote: I like it +3 Vote: I do not like it

    I just generated all values of SG and guessed, then I realized that $$$g(x)$$$ is equal to the smallest prime factor of $$$x$$$ ($$$g(x) = 0$$$ if $$$x$$$ is even))

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

C < A < D < B

»
8 days ago, # |
  Vote: I like it +40 Vote: I do not like it

Maybe I'm salty for not solving E, but is it ok to put a somewhat well known problem that apparently has a solution on the internet to a contest?

  • »
    »
    8 days ago, # ^ |
    Rev. 2   Vote: I like it +13 Vote: I do not like it

    I am not a big fan of E myself but its edu round so the authors are somehow justified

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Should such a contest be rated for anyone at all? C,D,E all were kind off not div2 level. If someone had a day where they did B and D fast enough (I couldn't, maybe thats why i am putting this out), E was a walkover.

»
8 days ago, # |
  Vote: I like it +3 Vote: I do not like it

Lovely problems thanks, problem B and D were a bit implementation heavy unless I just missed the obvious solution and did something unnecessarily long.

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

Why this code (https://codeforces.com/contest/2004/submission/276666440) shows strange behavior when all the array elements are equal, for example:
5 4
3 3 3 3 3
Shouldn't the answer be 3 here?
Also i tried printing the final array after all the operations done, and in this case it is 3 3 3 1 0, but according to code none of the elements should change. Where i am going wrong?

Update: There was problem with my keyboard language setting due to which a special character was in the input instead of 3. But the solution is still wrong i think.

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    The variable ind will still bea -1 after your operations on nums, adding an another verification may help.(Though the solution is still wrong as you don't need to adjust all the numbers)

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Okay, let me try once again, thanks.

»
8 days ago, # |
  Vote: I like it +1 Vote: I do not like it

Wasted so much time on B lol, though D was very enjoyable!

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I enjoyed these problems

»
8 days ago, # |
  Vote: I like it +14 Vote: I do not like it

If you ever feel stupid, I got +7 penalties on D despite solving it in 20 minutes due to writing this function:

Code
»
8 days ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

can any one tell me what is the wrong in my code in (d) or if i missed some cases may be 276679658

»
8 days ago, # |
Rev. 3   Vote: I like it +14 Vote: I do not like it

My sol for D looks like abomination 276680579

»
8 days ago, # |
  Vote: I like it +3 Vote: I do not like it

Lmao i just brute forced the first 100 grundy numbers and stared at the screen for 45 mins until i observed pattern

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    what is the pattern in this problem?

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      for even its 0 and for odd it is same as the grundy number of its smallest prime factor

      • »
        »
        »
        »
        8 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Oh god, I've just realized that I misread the statement completely LOL. There was two "not" in the statement @@.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

How do you solve D??

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    if x1 and x2 dont share a colour, then you want to find the closest city to the right of x1 and the closest city to the left of x1 that share only 1 colour, then you calculate which of the 2 paths is better. im so salty i couldnt implement this, but this is the solution i think

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      i was think if you find the closest city to minimum one between of them you can find the answer and i think this do same idea you mention but i got wrong 2

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

    I added a 13 minute video editorial. Hope this helps.

  • »
    »
    8 days ago, # ^ |
    Rev. 2   Vote: I like it +3 Vote: I do not like it

    For each pair query, there are three cases you have to consider:

    Case 1: The two portals are not opposites (i.e. they share a color)

    In this case, you can just directly teleport with a cost of their distance in the array

    Case 2: The two portals are opposite (they do not share a color), but between them there is a portal color combo which is different from both

    In this case, our cost is also just their distance in the array b/c you can just teleport to the element between them to get from one to the other

    Case 3: The two portals are opposite (they do not share a color) and there is no element between them which has a different color combo than either one

    In this case, we have to calculate the shortest distance from the left of the leftmost query point to an element different from it which is not its opposite and likewise for the rightmost query point to the right instead. We then take the minimum of these distances we call mindist which naturally gives the total cost for the query to be 2*mindist + the distance between the query points. If there is no such minimum distance (i.e. there is no way to get between the query points at all) then we instead output -1.

    One can implement the third case by iterating forward and backward through the array for each color combo to fill an array of pairs calculating the index of the nearest element that is not equal and not opposite to its color combo both to the left and right.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

can you tell me what's wrong in this solution for C? https://codeforces.com/contest/2004/submission/276677983

my code for C could pass the sample test cases but i kept getting WA after submission :(

i wasted 1 hr on it lmao, was C really so easy?

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    try using long

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    The problem is that if the array is initially of odd length, then you create a phantom element equal to 0 and further consider it as the original one and, accordingly, you can add values to it, which cannot be done, in fact, it does not exist.

    Test when the code is not working correctly:

    1

    3 1

    1 5 5

    Program output: 0

    Correct answer: 1

    According to the logic of your program, element 0 is created and the array turns from [1, 5, 5] into [0, 1, 5, 5]. After that, in order to get the optimal answer, your code adds 1 to 0 and you get an array [1, 1, 5, 5]. Thus, the result will be equal to 0.

    It turned out that we optimized the response using a non-existent element.

    In a situation where the array is of odd length, you need to use another method — immediately add the minimum value in the array to the answer and then remove it from the array, thereby making it an even length

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      wow i wasn't expecting an answer so well explained lol. thanks a ton, i understand it now.

      honestly i feel i could easily be cyan but i always mess up small things like this, for example related to the range of inputs, such as writing >x instead of >=x for some loop, etc. and realizing that after wasting 25 minutes on that. since you're blue do you have any suggestions for me?

      • »
        »
        »
        »
        8 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        The best practice will be to solve implementation tasks outside the contest and set a goal to pass the task the first attempt. That is, spend a lot of time checking all the key points of the code and be 99% sure that all the places are implemented correctly.

        In the contest itself, you can:

        1) Write a naive solution for small values and compare the answers received with the code that you are going to send

        2) Manually check the boundary values, experiment with the boundaries (try to change > to >= or even to <, try to change the data type (if an overflow occurs))

        3) Check each part of the code and intermediate values separately (whether the array was built correctly, whether the answer is updated correctly at each step, whether the necessary variables are used everywhere, etc.)

        Usually these steps are enough, if not immediately to send a solution without bugs, then after an incorrect attempt to quickly find where it can be the error and fix it

        • »
          »
          »
          »
          »
          8 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          makes sense, thanks. i'll try solving a bunch of div. 2 Bs and Cs and try to get them right on the first try

»
8 days ago, # |
  Vote: I like it +1 Vote: I do not like it

Is there a $$$ O(n^2) $$$ solution for F?

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

https://codeforces.com/contest/2004/submission/276639528

too tight constraints for D. This is a QlogN and not passing? [EDIT SOLVED . I was declaring the vector again]

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    O(N+Q) is possible (via previous/next tables for all six pairs, for example), so this may be a TLE intentionally

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      But there will be only 4 pairs possible

      https://codeforces.com/contest/2004/submission/276683926

      with vectors+lower bound tle.

      Do you mean to say the complexity is not O(qlogn) but O( (n+q)logn) ?

      • »
        »
        »
        »
        8 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I meant to say that an O(n+q) solutions exist, so I'm not sure if O(qlogn) is intended to pass. As @rahulmysuru7 pointed out, your code runs even slower, so it's not relevant to you, I was just guessing what might be the reason

        • »
          »
          »
          »
          »
          8 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Ohh I see. I will think of N+Q solution too.

          Thanks for the response <3

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

    @mahendraakshansh ~~~~~ for(int i=0; i<4 ;i++){ set ss = mp2[vv[i]]; .... ~~~~~

    yeah ,you fked up here. you are declaring and extracting the entire set inside here. making your code O(qlog(n) * n)

»
8 days ago, # |
  Vote: I like it +44 Vote: I do not like it

E is too educational even for educational round

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I dont get my solution is of O(qlogn) but I am still getting TLE on sixth test case, tried so many things but still got tle on sixth, please tell where I am wrong my submission, My submission Link

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    you are copying the whole vector everytime in binsearch, this could be the issue vector vec=mpp[s];

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      And, when I thought its better to be good at code writing , I fcked up. Thnx man got accepted

»
8 days ago, # |
  Vote: I like it +13 Vote: I do not like it

B is the hardest out of the first 5 tasks for me 😭 Also, how tf does E have like 1400 ACs? Do so many people know sprague grundy now?

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    apparently its a well known problem with solution on the internet, im just surprised so many ppl managed to actually implement D.

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    B was also hardest for me. I wasted 20 minutes on casework before just (correctly) guessing the pattern. E was googlable.

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I remember seeing a cf blog about game theory a few weeks ago that explained how to solve Nim problems, so that might be why

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    so, How B? Help me please !

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

      I just bruted for all bridges [i, i+1] upto 100 in the end

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

      Break the problem in several cases.
      ref : (https://codeforces.com/contest/2004/submission/276649235)
      Case 1: When there is no overlap ----> only blocking one gate will work.
      Case 2: When there is an overlap at exactly one point ----> Block two gates.
      Case 3: When both the intervals are same ---> Answer will be difference between them.
      Case 4: When all the 4 points given are distinct ---> answer will be diff b/w overlap region + 2
      Case 5: When only 3 of them(l, r, L, R) are distinct ----> answer will be diff b/w overlap region + 1

      Analyse all the cases in order on pen & paper you will get the idea.

      • »
        »
        »
        »
        8 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Oh I missed case 2, completely skipped my mind

        • »
          »
          »
          »
          »
          8 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Same here, took time to figure it out.

      • »
        »
        »
        »
        8 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        You can just consider the intersection of the two intervals(you need to place a door between every two cells). Then if there is anything to the left or right of the intersection you need to add 1 door for each case. In case the intersection is empty the answer is 1 as you pointed.

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    should I feel proud that the problem I found easiest was hardest for Candidate Master (even thought I could only solve till C) :///

»
8 days ago, # |
  Vote: I like it +61 Vote: I do not like it

Not a Nim problem

looks inside

a Nim problem

Why? Just, why?

  • »
    »
    8 days ago, # ^ |
    Rev. 3   Vote: I like it +17 Vote: I do not like it

    Fr I was not even thinking around the lines of NIM after looking at the title. 1400+ accepted submissions for that is crazy

»
8 days ago, # |
  Vote: I like it +17 Vote: I do not like it

One small step for man, a giant fall for my rating.

»
8 days ago, # |
  Vote: I like it +12 Vote: I do not like it

Don't know why I hate L and R problems which have O(1) solution. Just hate the casework! P.S Talking about problem B

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

Damn, my programming skill is so bad that I couldn't implement C. The first test cases in problems are weak and doesn't help to find even some edge cases. E has no explanation for how Bob wins in the third case. Next year will be our year.

»
8 days ago, # |
  Vote: I like it +10 Vote: I do not like it

if u ever feel stupid then just know that I exist : wasted my whole contest on C only to realize it was total increase<=k, not k for every element

»
8 days ago, # |
  Vote: I like it +2 Vote: I do not like it

The question of double negative sentences is very unfriendly to foreign contestants, which seriously affects the questioning, and I feel very angry about this

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone pl look what is wrong in my implementation of D.

Link

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    if it_low==pos.end() you should try finding the last position <= x

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

D was actually easier to implement than I thought after I realized you could iterate over the colors and only check when you found an overlap for both endpoints. Then just binary search on the nearest index.

Code
»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

A, B, C, D, F is fucking easy, especially E is just grundy number which is not suitable for an edu round!

»
8 days ago, # |
  Vote: I like it +12 Vote: I do not like it

fucking rooms

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

For problem E, I found out quite early that I had to build grundy numbers for all possible number.

But I completely forgot all the theories. Almost all the time that I took for solving E was trying to figure out grundy again and for reading the question wrong and solving a wrong problem first. :3

»
8 days ago, # |
Rev. 5   Vote: I like it 0 Vote: I do not like it

can anybody point out whats wrong with the below idea for D ? (since failing testcase 2 is not visible till end of hacking) Submission: 276681155

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

    Sounds right to me.(You mean "closest city to the right of y", not "largest city to the right of y", right?)

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      yeah i wrote that by mistake. I mean closest missing in the prefix of x and closes missing in the suffix of y. Looks like I effed up the code then. If you can take a look at it please ? (I assure you its written cleanly as much as possible.)

      • »
        »
        »
        »
        8 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Sorry, can't spot a bug immediately. Maybe there's some bug in the implementation detail in finding the closest city to the left or right? Some off-by-one error, maybe?

        • »
          »
          »
          »
          »
          8 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Yep, no problem, I'll find it somehow. Thanks a lot!

        • »
          »
          »
          »
          »
          8 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          found it: did subsum[l,r] = (psum[r] — psum[l]) instead of (psum[r] — psum[l-1]) :'(

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    if i understood it properly, that is the solution. the hard part of this shitty problem was the implementation

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    idea looks right, you might have made mistake in implementation.

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      thanks i'll debug against some AC solution I guess then.

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

I don't like problem B and E (because I had a hard time with them, obviously). B is a boring classification, and for E you only need to print out the table of SG function values and find the pattern. TBH I didn't feel the joy of solving Cf problems in these two problems.

»
8 days ago, # |
Rev. 2   Vote: I like it -7 Vote: I do not like it

just now I was searching for D solution on youtube and saw problem A,B,C ,E and F were uploaded there during contest

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

my submission for problem b gave some negative number for first submission- https://codeforces.com/contest/2004/submission/276574322

and same solution got accepted after a few minutes-

https://codeforces.com/contest/2004/submission/276595377

if it is some kind of error from system then please recalculate penalty for this problem for me

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

    I don't think they can be called "same solution".

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    The calc function in the first submission calls R itself in calculating R, which is undefined behavior

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

My code is producing the[submission:276685070] wrong answer, but I can't figure out why. Could someone help me identify the issue?

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

hmmmm whats wrong with my O(qlogn) solution for Problem D that got TLE on sixth test case? I realized that set::end is O(n) so i precomputed it in the what vector, but still didn't work. all other ops are O(1) or O(logn)

submission

»
8 days ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

didnt got D in time cause wasted 1 hour on fckn annoying B, for what do shit like that? B in hour, C in 10 mins)

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone help me?Your text to link here...

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Your code looks correct, but you're getting a Wrong Answer (WA) on test case 5992. Unfortunately, I can't see the specific details of that test case

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    bro whattt

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

I am getting tle on test 5 can anyone help 276686377 even if the soln is qlog(n)

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

i have no idea why my D is failing, i found the indices of all 6 types of values closest to the left and right and did accordingly am i missing something. solution

»
8 days ago, # |
  Vote: I like it +26 Vote: I do not like it

E wasn't new...

projecteuler560

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    This is allowed during Educational rounds. It's one reason why they aren't rated for Div 1.

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Source for this please

      • »
        »
        »
        »
        8 days ago, # ^ |
          Vote: I like it -8 Vote: I do not like it
        • »
          »
          »
          »
          »
          8 days ago, # ^ |
            Vote: I like it +9 Vote: I do not like it

          I don't think anything in the blog implies you can take exactly the same problem from somewhere else.

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

            It's not exactly the same problem.

            Project Euler asks you to calculate the number of losing positions with up $$$n$$$ stones in $$$k$$$ piles, while this round asked you to evaluate the winner for just 1 given position.

            Looks to me like the CodeForces problem is strictly easier, except of course Project Euler has no fixed time limit.

            It's true that the crucial insight behind the two problems is the same, so it's not completely new, but again, that's not unusual for Educational rounds and as far as I'm aware that's intentional.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone explain to me why the code I submitted during the contest was rejected but if I submit the exact code with 0 changes after the contest it gets accepted? In fact I modified the code to get the test cases where it was failing at and that code got accepted when I thought it is obviously wrong.Can someone go to my submissions and check?

»
8 days ago, # |
  Vote: I like it -91 Vote: I do not like it

awoo Why for Div2+ rounds you keep giving problems where cheating is extremely simple? No implementation, but only one critical observation which is extremely easy to pass from a cheater to another cheater.

  • »
    »
    8 days ago, # ^ |
    Rev. 2   Vote: I like it -18 Vote: I do not like it

    Since you are giving feedback to Awoo, regarding the contest. I would like to chime in.

    I didn't google a shit during the contest. usually I don't. For me, E was really good problem. except for one part, extra BOILER PLATE IMPLEMENTATION for sieve.

    I would like to understand what was the motivation to keep pile sizes 10^7 instead of 10^5.

    The problem would have been same, if the pile sizes were within 10^5. The core-crux of the solution logic would be same. generating prime till 10^7 and then doing extra implementation things, were more of boilerplate code.

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

      Maybe so you can't completely bruteforce the Grundy numbers and actually have to come up with the "Grundy number of x is the Grundy number of its least prime divisor"? That would make sense in my opinion.

  • »
    »
    8 days ago, # ^ |
    Rev. 2   Vote: I like it +7 Vote: I do not like it

    What problems are you talking about? C? For B and D, implementing a solution correctly is IMO much harder than coming up with it. For E, you still need to know about Grundy numbers and not screw up calculating for the small piles. And pretty much every single A is easy to implement, because it's supposed to be really easy, so there's not much organizers can do with that.

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

      I spoke about problems D and E in particular. Ok, please tell me if these solutions for B and D look hard to implement. Do they?

      • »
        »
        »
        »
        8 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I didn't realize B is just bruteforce-able like that and was thinking of an O(1) per query solution. I agree doing this is easy. As for D, I don't think your implementation is particularly easy, and looking at the comments, there's a bunch of people with the correct idea that failed to implement it, so I stand by it being difficult to implement.

»
8 days ago, # |
  Vote: I like it +5 Vote: I do not like it

Not that great of a contest IMO. A and C are fine, but B is just annoying casework, D is basically just implementation, and while I enjoyed E, it's googleable.

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

    In B u can only check if 'i' is in one segment and i+1 in the other segment for every i in [1,99] then add 1 to the answer, there's no need for casework.

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      True, didn't realize that doing contest. Doesn't really change my opinion about quality of the problem though, as the fastest solution still suffers from this, and I personally dislike when there's a fast solution that's more complicated than a (significantly) slower one, yet the slower one still passes everything.

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

    I liked problem B. There are different ways to solve it, some of which don't require a lot of case work.

    Problem B solution 1
    Problem B solution 2

    You complain that problem D is mostly implementation, but what's wrong with that? It's a programming contest, not a math contest.

    Going by your username, you probably love math problems, but if all problems are math-based other users will complain about “MathForces”.

    And problem E was much more math-heavy, so there was something for everyone. In my view the authors struck a good balance between math and code.

»
8 days ago, # |
  Vote: I like it +27 Vote: I do not like it

So, many $$$n^3$$$ solutions passed in F.

An easy way to fix it would have been to have $$$1 \le a_i \le 2 \cdot 10^4$$$, and decrease the TL to $$$3$$$s maybe. I had to use map because it was not possible to have a global vector of size $$$4 \cdot 10^8$$$. For the suggested constraints, one can simply use a global vector of size $$$8 \cdot 10^7$$$, and find $$$f(a[l,r])$$$ in $$$O(1)$$$ by traversing over $$$(l,r)$$$ in the increasing order of $$$r-l$$$.

»
8 days ago, # |
Rev. 5   Vote: I like it +24 Vote: I do not like it

some leaked codes that yall best be on lookout for

Problem A
Problem A
Problem B
Problem C
Problem D
Problem D
Problem E
  • »
    »
    8 days ago, # ^ |
      Vote: I like it +17 Vote: I do not like it

    All of them has the useless check in their code for problem E lol.

    if(grd[i] == -1) {
      cnt++;
    }
    
»
8 days ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

In Problem D, I got wronganswer on test 2. I can't find my mistake.can any one help me? 276676154, and why everyone use lower bound to find the closest point from x and y, cz the vector are sorted and we can find it O(1).

update : problem solved

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone help me understand what I missed in Problem D ?

Submission: 276664135

Idea:

If there is a Portal with same color available on source and target, then, it is target - source.

If not, then :

Let's say for example, source is BG and target is RY, then, I check for the minimum value of below logic with these 4 portal pairs — BR, BY, GR, GY. (i.e., trying to see if at-least 1 color matches). If no suitable answer, then return -1.

If any of these is present inbetween source and target, then, it is target - source.

Else if, it is present after target index, then, (foundRight - source) + (foundRight - target).

Else if, it is present before source index, then, (target - foundLeft) + (source - foundLeft).

Else, INT_MAX

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

    But four more cases are possible- RB, RG, YB, YG.

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

      .

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      The problem statement clearly stated only 6 types. Unlucky.

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Right. But, I took that into account in my code. I just missed to mention it in my comment above.

      Thank you for your reply.

      So, the mistake I did was that, I missed to take the minimum of these two scenarios :

      Math.min(

      (foundRight - source) + (foundRight - target),

      (target - foundLeft) + (source - foundLeft)

      )

  • »
    »
    8 days ago, # ^ |
    Rev. 2   Vote: I like it +1 Vote: I do not like it

    Else if, it is present after target index, then, (foundRight — source) + (foundRight — target).

    Else if, it is present before source index, then, (target — foundLeft) + (source — foundLeft).

    You need to take the minimum of these two, not just the first one that's possible.

    (Let's say you want to go from BG at 4, to RY at 6, and there are BR cities at 3 and 9, then clearly it's better to go via the city on the left at 3. But if BR cities are at 1 and 7 instead, then it's better to go via the city on the right at 7.)

    edit: Also remember to handle the case where target < source. You can simply swap the indices in that case, since distance is symmetric, but if you forget, some of your math might not work out correctly unless you put some abs() calls in there.

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

      That's exactly what was missed. Thank you very much for your reply.

      Can't believe I missed this. (When initially reading the problem statement I thought of this scenario to take minimum of the two. But, later somehow forgot after starting to code, and got deviated from it).

      (I did take into account the target<source scenario. I just didn't mention it in my comment above.)

»
8 days ago, # |
Rev. 2   Vote: I like it +17 Vote: I do not like it

I tried so hard to see the pattern from this sequence, which is the grundy value in the case we picked $$$y$$$ such that $$$gcd(x, y) \neq 1$$$. After contest I read the statement one more time and... F!!!!!!!!!!

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Although I am still gray while solving 1500++ problems but I think I have very bad luck. It is 1st time I solved 4 problems but could not submit the 4th one in time and the 2nd problem also took so much time for some silly edge case. I never cheated in any contest and I am happy for my hard work. I do not know if people cheated in this contest or not but I am happy for my rank as I did my best. But I am also mad for my bad luck. I do not know why every time I messed up for some silly edge cases. It happens in every contest specially in codechef ( yesterday also I messed up the 2nd problem but did 4th one ) as the give more observation base problems.

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

For problem c: 

276686828

// this is code

 a[j+1]=a[j+1]+min((a[j]-a[j+1]),k);
           k=k-min((a[j]-a[j+1]),k);

shows wa..

But- 276688213

// this is code

 ll h=a[j]-a[j+1];
            
        a[j+1]+=min(k,h);
            
        k=k-min(k,h);

Shows ac with same logic...

N.B.: All variables and array in long long data type

But why?? Is there any difference for min() function??....

»
8 days ago, # |
  Vote: I like it +14 Vote: I do not like it

Why would you refer to the operation in G as "process", when the most reasonable meaning of this word is a sequence of operations, not exactly one.

»
8 days ago, # |
  Vote: I like it -107 Vote: I do not like it

Petition for action on copied task E by recognizing it as unrated or in other possible ways.

The authors directly violated one of the obligations of the authors of the round: copied the task from an existing one, replacing some words that were not essential in solving the problem with others.

If you vote for this post, it is similar to digitally signing this petition. Let MikeMirzayanov and the authors see us and take action.

Thank you.


На русском:

Петиция о принятии мер насчет скопированной задачи E путём признания его нерейтинговым или другими возможными способами.

Авторы напрямую нарушили одно из обязательств авторов раунда: скопировали задачу с уже существующей, заменив некоторые несущественные в рамках решения задачи слова на другие.

Если вы голосуете за этот пост, это аналогично цифровому подписанию данной петиции. Пусть MikeMirzayanov и авторы нас увидят и примут меры.

Спасибо.

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    The problem statement is simple enough for the problem setter to come up with it independently and just failing to find it online (which would mostly be a failure of the coordinator). Still a big issue, but one of negligence, not of malice.

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      It is possible that the authors did not do this on purpose. But it is their responsibility to prevent such negligence. And a lot of users have found this task on the Internet, which further aggravates the situation

      like indian_rounds_LULW said 2 hours ago in comments:
»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I can't see why my submission for C is failing:

  1. Sorted the array in ascending order.
  2. Tried to equal pairs of elements
  3. Then alculated the score as the difference between each pair

I would really appreciate if someone could help

276684985

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    In the "increase to make i = i+1 for all i" part, in "k >= a[i + 1] — a[i]" state you should swap 2 lines in your if, otherwise k won't change at all.

    I think it's the only problem.

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

      totally missed that :(, thank you!

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Compare and feel... 276693772 (I copied your solution I changed a little bit).

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

My best chance to reach orange but stuck at F for an hour :(

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Its difficult to reach expert without doing graph. I skipped trying D question because I thought it was from graphs, I tried E then.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Well, my D sol got hacked, but I have no idea how I could improve the time of it. It's QlogN and it barely passed during the contest, so I'm not sure if it's just not the intended solution, or if my code is unoptimized (thought I tried to speed it up during the contest and didn't find anything) : 276659141

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    dont use unordered map ever

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

    use (auto &m: cnt) instead of (auto m: cnt).

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Sped it up 10x, thanks! Completely forgot about auto making copies, but I'm happy that at least I got the correct solution

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Where does this solution: https://codeforces.com/contest/2004/submission/276689812 fail? I've tried so many different test cases...

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

From Problem D why 276671958 gives a TLE but when I replace mp with a vector of vector it passes?

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Use for (auto &it : mp) instead of for (auto it : mp). You are making copies of it everytime.

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

need help in problem D, I keep getting TLE on test 12 (Python)... 276697598

My idea is binary search to get best choice for x on left and right (binary search 2 times) then minimize it.

UPD: Resolved TLE, it's list.insert(0, list) which I think O(1) but it's O(n)

»
8 days ago, # |
  Vote: I like it +2 Vote: I do not like it

I think this should be a pretty bad round. The first three questions are too simple, while the fourth question combines both simplicity and complexity. As for question E, it truly educated me:)

»
8 days ago, # |
Rev. 4   Vote: I like it -20 Vote: I do not like it

276687644

In probelm D, why does this give TLE on test 5, but when I changed unordered map to vector, it got accepted?

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it
»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I was so stupid that I spent 1 hour figuring correct cases for problem B and even then it failed 6 times.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I don't know why I am getting wrong answer on C on this submission 276671135 and right answer on 276689047 Can someone please help me with this

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

    a[i]+=min(k,a[i+1]-a[i]); changes a[i] and affects the following k-=min(k,a[i+1]-a[i]);.

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Oh such a silly mistake , thanks for pointing it out

      • »
        »
        »
        »
        8 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Made the same mistake.. took me 40 mins to figure out :(

        • »
          »
          »
          »
          »
          8 days ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Oh man, I was so frustrated coz of it that I left the contest midway.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Hiya, could someone let me know why this solution for D is giving TLE? Is it the cuz of the lower bound calls on the sets? 276676038

  • »
    »
    7 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I think that's because you use set, which will increase the complexity when inserting, and the order itself during traversal is already sorted, so if you replace set with vector, it can be accepted.

    • »
      »
      »
      7 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yeah I completely forgot about the insertion complexity, I was way too focused on the lower bound part. There really was no need to use a set, such a silly mistake. But yeah thanks a bunch for the help!

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

    lower_bound in the using set is slow you have to do it like that st.lower_bound(x); like that it won't TLE

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

My 311 ms B was hacked to tle. The pretests are awful.

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Get a load of this guy, so many notorious coincidences.

    First B solution got hacked, second one was FST'ed:

    Codes for D are nearly identical:

    ...so on and so forth

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I swear to god I never shared my code. I am thinking about someone hacking either my computer or codeforces server right now. Horrifying. I'm about to share this to my university group chat.

    • »
      »
      »
      8 days ago, # ^ |
      Rev. 2   Vote: I like it +3 Vote: I do not like it

      By the way I have recorded the whole coding process. It was all alone.

      ==============

      Figured out, I shared my account once and now I have to change my password.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Which test case am I missing? For question 2004B - Game with Doors. Here is my code. 276640556

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

My solution for D is in O(n + q) (so optimal time) using 6 prefix and 6 suffix arrays that are precomputed, that tell the earliest/latest (depending on if its the prefix or suffix) occurence of some 2 letters combination in O(n), now if a[x] and a[y] share anything then it's just y-x, if not, iterate through all other letter combinations, then look them up in the precomputed arrays and get the result from that

»
8 days ago, # |
  Vote: I like it +3 Vote: I do not like it

Love problem F. Very simple implementation for a hard problem. Shows how elegant CP can be.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

The number of people having their D solution hacked is CRAZY (including me)

»
8 days ago, # |
Rev. 2   Vote: I like it +19 Vote: I do not like it

$$$O(\frac{1}{6}N^3)$$$ solution for problem F.

link : https://mirror.codeforces.com/contest/2004/submission/276598378

Is it right?

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I'm curious why you mentioned a constant 1/6 explicitly.. is there any reason?

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

    In my opinion,it's not the intended solution but obviously the problem setter wants to let $$$O(n^3)$$$ solutions pass.

    Or there won't be awful constraints like $$$n\leq 2000$$$ and $$$5\rm s$$$ Time Limit which makes some $$$O(n^3)$$$ solutions with small constant like yours unhackable.

»
8 days ago, # |
  Vote: I like it +9 Vote: I do not like it

At first, I thought what we do in problem E, is pick y stones in the pile which has x stones, guaranteed the gcd(x,y) is not equal to 1. As I do this problem what I thought for almost half an hour, I realize that the statement says:

It is not allowed to take from the pile a number of stones y such that the greatest common divisor of x and y is not equal to 1.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

What was the idea for F?

»
8 days ago, # |
  Vote: I like it +3 Vote: I do not like it

How do I report suspicious submissions? I found several users that either have identical code to this comment or added useless snippets in their code (e.g. doing ans ^= 23333; twice) to avoid detection.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Why is the judging queue so long?

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

If the number of colors for D is not 4 but on the scale of $$$2\times10^5$$$, what will be the solution to the new problem? Can the new problem be solved with the given time limits?

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

In problem B, I implemented O(100^3) and give me TLE. I think my solution should be pass https://codeforces.com/contest/2004/submission/276617200

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

    But there are at most $$$t=10^4$$$ testcases while no extra constraints on the sum of $$$l,r$$$ were declared. So your exact time complexity is $$$O(tl^3)$$$ in which $$$l$$$ is the length of the interval, and total operations is about $$$10^{10}$$$.

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Never happend me before I will pay attention to the constraints. Thank you

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I made an Undirected graph for d and applied dijkstra for each query and ended up getting tle, D initially looked like a graph problem

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Could it be done using hashmap??

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    its a lot simpler than that

  • »
    »
    7 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Using Dijkstra to find the minimum cost would be even more computationally heavy than just traversing all the cities during each query.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Where is editorial

»
8 days ago, # |
  Vote: I like it +1 Vote: I do not like it

i am trying to submit but getting in queue from so long... anyone knows why? the contest was over 12 hrs back

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

All the people saying B was implementation heavy and included a lot of edge cases, just didn't get the solution right. You just need to traverse i from 1 to 99 and increment the answer if the room i lied in the first range and i+1 lied in the second range and vice-versa. There was just one edge case when there is no intersection between the ranges, the answer would be 1 in that case. You can check this submission for reference 276586168

I don't think B was a bad problem at all and the authors did a great job!

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Here is my submission 276639740 for C but I got WA on test 4. Who can explain why??

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone please explain me this? My contest submission for Problem D was hacked https://codeforces.com/contest/2004/submission/276679036 But when I submit the same solution now, it gets accepted https://codeforces.com/contest/2004/submission/276743351

Also, I had 2 solutions (using map & unordered_map) which got accepted during the contest. What happens if one of them fails the systests? Is it the final submission that is tested or if any of them works then we get an AC? I was getting a TLE in D so I was trying different things and was not sure what was the best way to do this.

Thank you

  • »
    »
    8 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    if you have 2 subs in contest one hacked and one still AC. u will take points for the accepted sub by its submission time. (This for edu rounds only)

    For D, why it works because it's probable that system tests have not been updated by hack tests yet. system testing didn't happen.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Oops.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Why is my game still unrated now?

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Why are the ratings not yet updated?

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

    System testing is not completed yet.

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anybody help me find the error in my code for problem C

Solution Link: https://codeforces.com/contest/2004/submission/276717142

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

    Same mistake as this.

    Note that alice -= Math.min(alice, k); affects k -= Math.min(alice, k);

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

F with $$$\mathcal{O}(n^3)$$$ complexity passed, but my solution in $$$\mathcal{O}(n^2 \log n)$$$ got TLE because I used "push_back" $$$2\times 10^6$$$ times. However, the problems are very nice, thanks for the problem providers!

»
8 days ago, # |
  Vote: I like it -24 Vote: I do not like it

I may got $$$22$$$ unaccepted submissions on problem A of this round, I want contribution!!!!!!!!!!!!!!!

Please give me contribution!!!!!!

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Why is this contest rated so low ?

»
8 days ago, # |
  Vote: I like it 0 Vote: I do not like it

TL47 on F, BLYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

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

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

    This guy is the next LGM. Solving every question in <10 minutes. LOL keshavgarg8800

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

    coming from a person who solved 10 questions in his entire life and he is at expert level

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

      please have a life! Cheating in contests won't take you anywhere. your submissions have literally [................................................] these big variable names. clearly you have cheated!

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I don't know exactly that maspy account was hacked or that is cheating but the submission 276630607 and 276683562 of Sparsh_Mittal are the same during this contest.

  • »
    »
    7 days ago, # ^ |
      Vote: I like it +17 Vote: I do not like it

    This submission 276683562 was done 14 minutes after the end of the contest when solutions were already available to everyone.

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Hi everyone, why is the contest showing unrated for me even tho my rating is less than 2100. Any idea?

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I implemented an Nlog(N) solution for problem D (276652556), but since I coded it in Java, which is slower than C++, I got a Time Limit Exceeded error. This happened after the contest, putting me behind 2.5k more participants. Later, I submitted the same logic in C++ (276815660) with the help of ChatGPT, and it got accepted. This isn't the first time I've experienced this issue—same logic gives TLE in Java but passes in C++. I hope MikeMirzayanov can look into this and resolve the issue. I was close to becoming an expert after this contest, but due to the language (not the logic), I lost that chance.

  • »
    »
    7 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    if youre aware of this, why not just code in c++.. mike cant make java run faster

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

      Mike can do something about this. On Codeforces, certain languages like Python often get a time limit multiplier (2x or even 3x) compared to C++. This allows users to code in other languages too.

      As for why I don’t just switch to C++—I feel more comfortable coding in Java at the moment. Since Java is an available option for submission, it should be viable. If uniformity across languages can’t be ensured, then perhaps it’s better to remove Java as an option altogether.

      • »
        »
        »
        »
        7 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        On Codeforces, certain languages like Python often get a time limit multiplier (2x or even 3x) compared to C++.

        This is false for official rounds.

  • »
    »
    7 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    that is like saying you can't win an F1 race because you used a 2nd hand honda civic, there's a reason why almost everyone here codes in cpp but i'm sure you could've done something to optimize it in java itself, try looking it up online

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

      I get your point, but the analogy isn't quite right. Codeforces supports multiple languages, so it's fair to expect some parity. I've already optimized my Java code (276816388), and it still runs close to the TLE (just 79ms away, might give tle if we run it again). On the other hand, unoptimized logic in Python (276837719) is giving runtime close to C++ (276815660) because of better time scaling, even though Python is slower than Java. So, even a 3rd hand Honda Civic can win if the rules are well-structured.

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

        I notice that you are using the standard Java Scanner class. This is generally not recommended. Here is your first solution with my modified version of Kattio, 276843722.

        I used to be a Java enjoyer for competitive programming. And I still enjoy using Java for other tasks. But it only took me a week to start using C++ comfortably (at least in CP). It is not an undue burden to expect the contestants to be mindful of what language they use.

        Two reasons I wouldn't want some sort of time scaling:

        1. The CF judging servers are already stressed out. Adding a time multiplier for certain, usually more burdensome languages, would add on to this stress.
        2. Some problems are intended with certain time limits in mind. With a time multiplier, this can sometimes, unfairly, be bypassed. For example, in the USACO, certain O(n^2) solutions that wouldn't normally pass in C++, would pass only in Java because of the time limit multiplier. This goes against the intentions of the problem writers.

        People have gone to fairly high places on this website with alternative languages, such as Java. Worry about improving your problem solving skills, because at our level, the language choice really doesn't matter that much.

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

    Dudee, check out my Java code for D 276647600

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

when will ratings update?

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

When are our ratings going to be updated after this round? It's been over 24 hours now, or is this a normal thing?

»
7 days ago, # |
  Vote: I like it +1 Vote: I do not like it

Why are the ratings still not updated in the platform?? It's over 24 hrs!!

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

    They will probably update rating for this round after recalculating the rating changes of the last div1+2 round. Lot of cheaters were skipped but rating hasn't changed yet

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

still unrated....

»
7 days ago, # |
  Vote: I like it +7 Vote: I do not like it

I swear to god if i wake up and ratings still not updated

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Ratings when?

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Not satisfied with my performance in this contest. I will try to improve in the next contest.

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Well My solution got a plag warning. But seriously I haven't copied from any source but I Googled to read a few sources to optimise my solution as it failed to pass all the test cases I implemented in my IDE. Any suggestions on how to make our code more unique and plagiarism-free are highly appreciated.

  • »
    »
    6 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Stop cheating.

    I never thought about creating unique solution and never got skipped verdict.

    And also explain these lame excuse to those who have never coded in their life.

  • »
    »
    5 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Your previous 2 contests were skipped. You are clearly cheating lol.

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Just googled what is nim numbers in hoping to find something related to it. https://codeforces.com/blog/entry/66040 This CF article is literally what I did in my solution to E using something similar to Sieve of Eratosthenes. Kind of modified the code used here: https://www.geeksforgeeks.org/combinatorial-game-theory-set-4-sprague-grundy-theorem/

»
6 days ago, # |
  Vote: I like it -9 Vote: I do not like it

Dear Codeforces Team,

I have received a notification that my solution for problem 2004E (submission ID: 276630140) significantly coincides with the solutions of other participants. I would like to clarify that my approach was independently developed using well-known concepts from combinatorial game theory, specifically the Sprague-Grundy theorem, which is a standard method for solving problems of this nature.

My solution is based on calculating Grundy numbers to determine the outcome of the game. This technique is well-documented and is commonly used in problems involving impartial games, such as Nim. Given that these concepts are fundamental and widely taught, it is likely that multiple participants arrived at similar solutions independently.

For reference, here are some sources that explain the theory behind my approach:

Sprague-Grundy Theorem on CP-Algorithms Game Theory: Sprague Grundy Theorem on GeeksforGeeks Nim Game and Grundy Numbers — TopCoder I assure you that I did not engage in any form of code sharing or plagiarism. My work was done independently, and I am committed to upholding the integrity of the competition. If needed, I am open to providing further details or discussing the specific steps of my solution to demonstrate its originality.

Thank you for your understanding

  • »
    »
    6 days ago, # ^ |
      Vote: I like it +3 Vote: I do not like it
    Your Code for E

    Coincidentally, your solution and the leaked solution both have this useless check

    check
»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

My code coincide with my other account because I didn't know multiple accounts are not allowed on cf hence kept the other one kalfiaaa for practicing

  • »
    »
    6 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    But will not go against rules of cf for sure

»
6 days ago, # |
  Vote: I like it -11 Vote: I do not like it

Attention!

Your solution 276582979 for the problem 2004B significantly coincides with solutions sushi_666/276582979, Farhan.WaheedSS/276587437, AryanSeth/276637757, parshiv_k/276649425. 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.com/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. Hello I got a message about my code being plaged in B. I dont know any of the other three remotely, and by looking at the submission time I hope its evident that my code isnt something like a copied code. I also didnt use IDEONE so thats out of question. This was one of the best contests I ever had so please remove the plag check if you belive Im innocent which I can guarantee you that I am. I went to pupil after a long struggle and dont wanna lose the rating for something I didnt even do. Please awoo help me with this one.Thank YOu

  • »
    »
    6 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    The submissions are the EXACT SAME, except for random newlines that don't do anything.

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Can someone Help me in D problem, why am i getting a tle at test 6, here is my solution link

https://codeforces.com/contest/2004/submission/276709586

  • »
    »
    6 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Replace for (auto it : msi) with for (auto& it : msi).

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

      Thanks a lot bro, it worked, but why there was a tle? and what difference does the & play? also when we need to use auto & and when is it not necessary? can you provide some clarification please..i was just using auto it for all my answers till now, is it working because auto it was creating copy of itself in O(n) and hence giving tle, and auto& it is passing it by reference and hence don't give tle?

      • »
        »
        »
        »
        6 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        The auto version copies the entire vector for each iteration, in the same way as pass-by-value function arguments.

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

Your solution 276648513 for the problem 2004D significantly coincides with solutions davit_tsibadze/276637520, morphinecode/276648513.

I want to clarify that this is merely a coincidence, I don't even know the other person, we don't even belong to the same country, I wasn't using any third party code editor and this isn't even a case of leak as he is the only person whose code shares similarities.

I want to point out that there are significant syntactical differences between both solutions, it is just the binary search part that matches and since the binary search was repeated 6 times so it caused a lot of same syntax.

I wish Mikemizayanov, awoo, and the authors adedalic, BledDest and Neon to take a look at it and solve this issue.

»
6 days ago, # |
  Vote: I like it -14 Vote: I do not like it

I am writing in response to the email regarding my solution (ID: 276675706) for problem 2004E,and 2004D which has been flagged for significantly coinciding with 1 other user solutions. I would like to provide some context regarding how my solution was developed.

For problem E, both my code vedu1004/276669741 and other user code yash3003/276669660 are in different language and the code structure is also very different.

For problem D, I asked ChatGPT to generate a helper function. Given that the approach is relatively straightforward, it is possible that another user who used a similar tool might have ended up with code that appears similar to mine.

I want to clarify that I did not share my code with anyone, nor did I receive code from others. The code I submitted was based on my own work and public resources that were available before the contest. I wish @Mikemizayanov, @awoo, and the authors @adedalic, BledDest and Neon to take a look at it and solve this issue.

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

    Another incredibly obvious cheater. Vast majority of the code from the submissions in your post, including, but not limited to, the entire while(query_count--) loop, is exactly the same except for variable names. Codeforces plagiarism checker is smart, and trying to outsmart it like this is futile.

»
6 days ago, # |
Rev. 2   Vote: I like it -6 Vote: I do not like it

Attention!

Your solution 276640318 for the problem 2004D significantly coincides with solutions prj11137/276632543, AryanM/276640318.

Prj11137 and I (AryanM) were working on some project using liveshare, and the contest started so we continued to use that, For question D I took help of copilot for some code completion, but it suggested more code which looked fine to me and so kept that code. But as per the code submission time, prj11137 had already written his solution so maybe copilot was taking that as the reference and providing suggestions as we also use almost the same template from benq. That's why our code has some similarity. I didn't realise copilot was actually looking at a solution. prj11137 MikeMirzayanov

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

can anyone pleaseeeeeee tell me why my code (277063683) for problem D might be failing ? I think am missing just 1 edge case, not sure..

Edit — Found it!

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

my code coincide with my other account. I did not understand that having two accounts would be an issue, so I used both. I have now thoroughly familiarized myself with Codeforces' rules, and I will ensure that no problems arise in the future. Could you please restore my contest results that were unrated? MikeMirzayanov