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

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

Hola, Codeforces!

We're glad to invite you to take part in Codeforces Round 1056 (Div. 2), which will start on Oct/05/2025 19:35 (Moscow time). You will be given 6 problems and 2 hours to solve them. At least one of the problems is interactive, so please read the guide for interactive problems if you are unfamiliar with them.

This round is based on the 30th edition of the Mexican Olympiad in Informatics (OMI).

Please note the unusual starting time.

The problems were authored and prepared by jampm, efishel, Marckess, JuanPabloAmezcua, IvanBorquez, SebR, Teto and me. We hope you enjoy the round as much as we enjoyed setting it!

The team would like to thank:

Score distribution: 500 — 1000 — 1750 — 2000 — 2250 — 3000

We wish you happy coding and good luck to all participants!

UPD 1: Added score distribution and new testers.

UPD 2: Added notice about interactive problems in the round.

Congratulations to the winners!

  1. misty
  2. Mirali777
  3. BlackLily
  4. AI-qv4rk
  5. trigger.cpp
  6. AKBEROV
  7. dingdong
  8. shade34
  9. CAMOBAP31
  10. aucoder123

UPD 3: Editorial is out! Sorry for the delay.

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

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

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

As a tester I tested :thumbs_up:

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

As a tester, I want a taco :)

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

Yo espero que el concurso sea muy bueno

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

Gray tester here.

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

Hope to have good problems!

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

Hope the problems are as interesting as the last Mexican Round. It was worth it to wake up late night and attempt the contest.

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

As a problemsetter, +67

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

Hope to get good problems, and be specialist.

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

Hope to have good problems and get expert!

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

everyone wish __baozii__ good luck for his midterms so that he can do well and become a tester again

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

[user:JuanPabloAmezcua]Taco, Tortilla, Burrito

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

As a gray tester. I tested

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

Happy Mid Autumn Festival!

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

burito

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

We will never have a global shortage of Burritos now!

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

As a tester, i tested?

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

1750 after 1000?

we are cooked

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

As a non-Mexican participant, I can say burritos aren't as good as people say.

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

As a Tester, hope you enjoy the round!

Thanks to the writers

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

As a tester, I'm scared of problem A

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

I really want to play this match, but I might be half an hour late.

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

As a participant, Good luck to everyone!

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

is it rated?

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

Try out this extension, https://marketplace.visualstudio.com/items?itemName=DevXSayan.cf-submitter all problems of a contest inside vscode, code faster, run test cases and submit like a pro – all without leaving VS Code!

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

I hope to be expert again :)

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

How is the time of a contest specified?

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

OMI was the direct inspiration for OCI in Costa Rica, so good job guys on making these opportunities for students :D

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

Contest will start in 10 minutes, so best luck for everyone :)

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

Finally! A contest that is actually at a good time for PST (US & Canada) coders such that you do not have to wake up at like 4-6 am and is also on a weekend! Thank you!

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

Thanks To Organizers!

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

I have lost 300 elo and fell off 2 colors in 4 contests. AMA!

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

What's the deal with TC14 for D :'(

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

we're failing system testing with this one

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

I think the sole purpose of modulo 676767677 in problem C was to let us know that it is a prime no. :))

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

authors while writing div2C


Spoiler

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

how to do C? spent total time on it but couldn't figure it out

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

    Tracking changes while iterating from left-right: by caseworking all 4 cases of 2 adjacent ones, you'll notice that the amount of seen wizards can change by at most 1 => if it's >=2, it is bullshit

    Basically, for the other situations: If the amount of seen wizards are the same across the entire array, some simple casework is sufficient (again, just write the case for N=3 and N=4 out).

    Otherwise, when the amount of seen wizards differs by at most 1 between 2 adjacent elements, you can identify at least 1 wizard, and from that reconstruct the entire sequence. After that, just slap some prefix sums to check whether the sequence is consistent to the input or not

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

Absolutely RAGING ON D! T_T

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

I didn't know div2C so I wrote brute force and saw that answer is always <= 2

so I made some observations from that brute force lmao .. fingers crossed for system test.

is there a cool way to solve this problem easily ?

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

    See tourist's code
    It's amazing

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

      OK .. very cool..

      I understand it because of the observations I made, so able to make some sense, except that accumulate thing ..

      This is truly amazing to me, how clear the thought process is when writing that code.

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

        i am unable to see anyone else's code, it shows N/A when i click on their submission, any fix?

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

          oh I am not sure why, but maybe you need to get some more rating to see other's code ??

          but pasting here for your reference


          Tourist's submission for problem C
»
12 месяцев назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

What happens in problem E in the following situation?

Starting grid:
2 2 2
1 2
2 2

Mimo cannot directly place the token in column 1, because it results in a loss, so WLOG we get
x0
x2.

Then Yuyu cannot directly place token in column 2, so we get
x1
x1.
The game then continues indefinitely. What have I misinterpreted?

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

Wasted a whole lot of time, trying to prove the answer of problem A. and lol modulo 676767677 lmao

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

Very nice B

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

Screencast with commentary (once it is processed)

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

i don ' t know why my B can 't be accepted

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

Problem C reminded me of 1952E - Sweep Line

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

Thanks the mod 676767677 for forcing me to think about dp for 1 hour straight. Also, for problem D, I literally write the code (Poor Me).

Spoiler

Overall great round.

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

How to solve D,i saw submissions of top contestants and everyone is querying pairs with increasing absolute difference but WHY does that work and how does SO MANY people know it?

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

couldn’t able to think of a single approach for C.

anyways good problems.

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

Are there any dp solutions for problem C apart from constructive algorithms? (although it must be less feasible) The problem seems dp-able (as it is asking for the total number of ways) and many problems exist a way to overkill it despite difficulty (It will be fascinating as it usually involves fancy algorithms I have never heard of). However I struggled to find an available dp state in O(n) or O(n log n) and wasted over half an hour on it. Thanks!

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

Is F just sqrt-decomposition by color occurence frequency?

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

      This TLed for me

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

      Well, looks like another one reason to finally learn Mo on trees :)

      My idea was :

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

    I think about that too but due to the n, k, q = 3e5 I think it will TLE or MLE.

    it will be O(1.5e8) pure time no constant factors

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

    For each distinct query, if you only check colors from the vertex whose set of colors has smaller size, I believe the total number of (query, color) pairs is bounded by $$$\max(n,q)\sqrt{n}$$$ or something of this form. After that you can use DSU to solve for each color, which barely passed for me.

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

HI

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

I an Candidate Master, but why I am out of competition?

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

It is the second competition on CodeForces that I have taken part in. Once again,I can only solve the first problem.

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

Thanks for your efforts in making the contest! There's some room for improvements in the tests. A lot of people are passing D with code like this:

    for (int d = 1; d < n; d++) {
      for (int l = 1; l+d <= n; l++) {
        query(l, l+d);
      }
    }

(note that the correct solution looks similar but iterates over segments wrapping around the end). When $$$n=40$$$, $$$a=3$$$, and the working batteries are numbered $$$1$$$, $$$n/2$$$, and $$$n$$$, the number of queries is around $$$570$$$ versus a limit of $$$533$$$. I saw some submissions with this error during the contest but was disappointed to see that hacks are disabled for the problem. I think it would be instructive to have it as a test for upsolvers in the future.

For problem E, it seems like $$$O(tm)$$$ solutions are not intended to pass based on the constraints, but the constant factor is too low to punish it.

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

    yes, u are right even i got accepted verdict on D using the incorrect logic you mentioned. I think they should just add a few cases and rejudge D

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

    Yeah $$$O(tm)$$$ should be Blocked. But It passes Can there be a way to TLE these??

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

    I now wonder how the adaptive grader even works. In principal it should be able to run a test for some $$$n$$$, and at each $$$\lfloor n^2/a \rfloor$$$ it should check if the max independent set of the graph of queries is $$$\geq a$$$.

    This would mean there exists a way to place the batteries, such that you didn't find a good pair yet, while you already did the maximum allowed number of queries.

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

      The adaptive grader was coded like that, I used the kactl code for reference lol.

      I didn't make the tc tho. Funny enough, for our national olympiad I did the tc's and that same solution is the one that the national winner did and got WA ;-;

      I'm sorry for that :(

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

On A I thought matches were the same as iterations... and unfortunately the set of inputs that this gives a correct answer for is exactly the inputs given in the sample. Was so confused

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

Hey, allow me to do the hack for D question please.

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

About problem D: during the contest I asked a clarification about whether the working batteries are fixed within the same test case, since the statement says "whether battery i (1≤i≤n) works is not fixed and may change during the interaction", but in the notes (say, the second) the working batteries are fixed (1,4,6 and 9 in that case). Judges replied "this is just an example for the sample test case, in the real judge, they can be shuffled after each query".

Since they can be shuffled after each query within the same test case, I understood that the result of a query has no relation at all with the result of previous queries in the same test case (except for the value of "a" and "n"). In fact, I could query, say, "1 2" and get 0 (no) as answer, and then just query "1 2" again and get 1 (yes) as answer, since the batteries were shuffled in between.

Given that, how to solve D without heavily depending on pure luck, since previous queries seems to have no userful information at all for the next ones?

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

    If you've ever played "Evil Wordle", the concept is similar — the answer is not determined from the start but will never contradict a previous guess

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

    The note in the statement about adaptive grading gives the answer to your question:

    However, it is guaranteed that there exists a configuration of $$$a$$$ working batteries that is consistent with the information that you have received so far.

    So this means that even though the grader can shuffle the batteries there's always some state of batteries consistent with all the queries until now.

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

      Does that mean that the interactor reads our inputs across tests and tries to avoid certain patterns in our queries? If that's the case, how do authors write such an interactor?

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

        What I'd assume it does is that it answers 0 to all of your queries until you ask all $$$\frac{n(n-1)}{2}$$$ pairs, and then, for all $$$a$$$ starting with $$$n$$$ and going down to $$$2$$$, once it reaches $$$\frac{n^2}{a}$$$ queries, it checks whether the maximal independent set of the graph whose edges are the queries you asked so far is $$$ \lt a$$$, and if it isn't then that means that there is an arrangement of batteries where your solution is incorrect so it gives you WA.

        Though, as some others have pointed out, there are some wrong solutions which still give AC; I don't know if it's because they did something different or if it's because there's a bug in the interactor.

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

    The adaptive grader is just to counter randomized solutions, but that shouldn't affect deterministic solutions in any way.

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

How are O(t * m) solutions Passing for E.

Contest authors should design good test cases many O(m) are passing. Its bad

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

Can somebody kick the codeforces servers? Some submission is staying in the queue and not letting system tests finish.

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

Almost figured out everything possible for problem C

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

luckily solved D in 8 minutes by intuition lol
i've got +150 rating boost and expert, but i'll probably loose it soon XD

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

Tourist and code of many more individuals will fail for problem D. case : n = 40, good batteries: 1 14 27 40 (provided by karan_garg_12)

Those who did not consider pairs (i, (i+len)%n+1) for n — len <= i <= n will fail this case. Is there a way to include this case into system tests and re-run the submissions for problem D?

Below is tourist code which takes 403 queries for this case. Which is more than allowed(400).


#include "bits/stdc++.h" using namespace std; int32_t main () { int n=40; int q = 0; set<int>st; st.insert(1); st.insert(14); st.insert(27); st.insert(40); bool won = false; auto ask = [&] (int x, int y) -> void { if(won) return ; q++; won = st.count(x+1) and st.count(y+1); }; for (int len = 1; len < n; len++) { for (int i = 0; i < n - len; i++) { ask(i, i + len); } } cout<<q<<endl; }
»
12 месяцев назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

This round is rated to Div1? My rating was above 2100 before the round begin, and the beginning my handle was with a *, and when I registred, I think that I saw the messange of out bound, but my rating was recalculated, this occour with other people? Please someone can explain me, I got orange in the last round for the first time, sometimes I don't know the rules.

»
12 месяцев назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится
    cin>>n;
    set<pl> s;
    for(int i=2;i<=n;i++){
        for(j=1;i+j-1<=n;j+=i){
            for(k=j;k<i+j-1;k++){
                if(s.find({k,i+j-1}) == s.end()){
                    cout<<k<<" "<<i+j-1<<endl;    
                    s.insert({k,i+j-1});
                    ll val;
                    cin>>val;
                    if(val) return;
                }      
            }       
        }
    }

Should This Solution work theoretically as there are lot of discussions going on so just wanted to confirm my solution.

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

When is the editorial coming?

Excited for this one.

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

how can i get solution of problems

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

I got some unexpected verdicts during hacking, could you look at it?

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

Hi Codeforces, I know I have low rating but I'll post my solution to C in case anyone will benefit from it:https://codeforces.me/contest/2155/submission/342138797

I wrote down my thought process in the comments.

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

solve C by classification discussion

Although the code is long, it works well

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

Here is a clean brute force implementation for C

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

    Thankyou — Really great solution — was struggling — it helps a lot :)

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

    I had a similar solution where I try to create both the configurations, and check how many of the two are valid. The idea is that if there is a transition L -> L then the wizard seen count increases by 1, R -> R then decreases by 1, else it stays the same for transitions L -> R and R -> L. If abs(a[i] - a[i - 1]) > 1 then no valid configurations exist. Also, I only need to verify if the config is valid for a[n - 1] or not. If the config length is n then I know that it is valid for all a[0], a[1], ..., a[n - 2]. So, only a[n - 1] needs to be verified, which is easy.

    342166485

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

    thx for the algo, had found conditions of <=2 answer and the adjacent same-different positions but couldn't code in time

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

As an Olympiad participant, seeing problem C having you answer mod 676767677 is funny af, we didn't have that on the olympiad version of the problem.

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

Okay, so for problem D, I couldn't get my head around querying for $$$(i, (i + d) \% n)$$$ (iterating over $$$d$$$) until we find a working pair (if anyone could explain it concretely with a proof it would be nice :).

I have solved it using a slightly different approach, say we divide the batteries into $$$\alpha$$$ sets, if we check for every possible pair in these sets, and we do not find any working pair of batteries, it is guaranteed that $$$a\leq \alpha$$$ (if $$$a \gt \alpha$$$, then we must have atleast one set with $$$2$$$ working batteries and we are bound to hit them).

Also, if the objects are evenly distributed the number of queries required will be $$$\alpha \times \binom{\frac{N}{\alpha}}{2} \leq \lfloor \frac{N^2}{\alpha} \rfloor$$$.

So now, I maintain a set of sets(containing pairs we have tested so far), at each iteration take two sets with the smallest size(say $$$p$$$ and $$$q$$$, smallest so as to maintain similar size between sets) and merge them in $$$p \times q$$$ operations(take all possible pairs such that one is from the first and other from the second set, this ensures that I do not query any pair that I have already encountered).

As the number of sets decreases, the upper bound for $$$a$$$ reduces by $$$1$$$ at each step(and we do not exceed the query limit), so we are bound to find a working pair.

This might be effectively(or I would say painfully ineffective) the same as querying for, $$$(i, (i + d) \% n)$$$, but I couldn't prove their equivalence, comments on this approach/proof would be nice.

Here is my submission 342162376 for reference.

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

Can someone help me out: I dont understand where my submission for problem B is failing 342165930

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

Is there going to be a editorial?

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

Does anybody has a clean DP solution or can help me debug mine. Here is my code : 342080947

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

In problem D, to comeover the issue mentioned in this comment you can increase the query limit to [n^2/a]+50. This is the safest way i think.

Even tourist did it the same way !

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

24 hours after the contest and still no editorial!

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

Will there be an editorial?

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

I feel E is easier than C and D. I stuck on C for a long time. Should do E first.

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

editorial?

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

When will the editorial be out , gotta upsolve the contest.

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

Editorial still not available..

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

Come on guys, please post the editorial, I am going through upsolving struggles.

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

Please release editorials :(

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

ждем разбора день 3

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

Hello team, Recently, I got a warning for problem B. I solved it completely on my own and can explain my approach if needed.I think this happened because of a similar approach or code structure.From next time, I will make sure to write code with a different template to avoid such coincidences.

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

Hello, I received a message that my submission [342085810] for Problem 2155C coincides with another user’s solution. I want to clarify that I did not copy code from anyone. I discussed my approach with ChatGPT to refine my logic and implementation, which might have led to structural similarity with another submission. I now understand that using AI assistance during a live contest violates Codeforces rules, even unintentionally. I sincerely apologize for this and assure that I will write all future solutions completely on my own. Thank you for your understanding.

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

hey guys, maybe i need some help or advice, I really want to get good in problem solving not just because of this ratings or it might help in jobs or xyz reason . I just feel that i dont have good mathmatical mind but i want to improve it and be better at this as i feel valued and it feels good when doing codefoces as it forces me to come out my comfort zone.I need some advice how can i be more better in my problem solving skills?

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

Dear Codeforces team,

I believe my solution was falsely flagged for plagiarism in this contest.

The problem in question had a very simple approach, and my code was written entirely by myself.
It’s possible that my solution looks similar to another participant’s because there were few natural ways to implement it.

Here is my code for reference:

342072853

I did not share or receive any code with anyone.
Please kindly reconsider this ban.

Thank you very much

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

Hello, I received a plagiarism warning for my submission 342105427 for Problem 2155B.

I sincerely apologize for this mistake. I didn’t intend to violate the fair play policy, and I will make sure that this never happens again. In future contests, I will only use offline or private environments and will keep my code completely confidential.

Thank you for your understanding.