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

Автор Misuki, 8 дней назад, По-английски

Hello Codeforces! (你好, Codeforces!)

Kaey and I are glad to invite you to Codeforces Round 967 (Div. 2) which will start on Aug/20/2024 17:35 (Moscow time).

The contest will last for 2 hours with 5 tasks for you to solve, and 1 task will have subtasks. The contest will only be rated for those with a rating not higher than 2099, but higher rated users are also more than welcome to participate out of competition. There is at least one interactive problem, so please read the guide for interactive problems if you are unfamiliar with them.

Holding the contest would have been impossible without the help from:

The score distribution is $$$500 - 1000 - 1500 - 2000 - (2000 - 2000)$$$.

Good luck and have fun!

UPD1: Editorial

UPD2:

Congratulations to the winners:

Div.1 + Div.2:

  1. maspy
  2. Mangooste
  3. kotatsugame
  4. Rubikun
  5. potato167

Div.2:

  1. kkkksc03
  2. ThMinh_
  3. yifeizhu
  4. activedeltorre
  5. suuuuuu
  • Проголосовать: нравится
  • +430
  • Проголосовать: не нравится

»
6 дней назад, # |
  Проголосовать: нравится +39 Проголосовать: не нравится

Excited to see the problems! Misuki Kaey orz!

»
6 дней назад, # |
  Проголосовать: нравится +53 Проголосовать: не нравится

As a tester, I forgot the number of interactive problems there :)

»
6 дней назад, # |
  Проголосовать: нравится +30 Проголосовать: не нравится

Misuki orz!!

»
6 дней назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

Interactive problem

»
6 дней назад, # |
  Проголосовать: нравится +108 Проголосовать: не нравится

As a tester, I can confirm that the round is supercalifragilisticexpialidocious, too.

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

    I believe that Misuki's dedication to the round is definitely worthy of honorificabilitudinitatibus!

    • »
      »
      »
      3 дня назад, # ^ |
        Проголосовать: нравится -6 Проголосовать: не нравится

      Bro, I solved 2 questions in this round without any resubmissions or wrong answers and my rating decreased by -6, can u tell me why that is. I'm new btw

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

    Bro, I solved 2 questions in this round without any resubmissions or wrong answers and my rating decreased by -6, can u tell me why that is. I'm new btw

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

      You have submitted them too late. Submission time also matters.

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

        Really, I mean is it not like ur rating increases by lower points rather than it decreasing.

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

          Your rating only depends on your rank in the contest, irrespective of how many problems you have solved.

»
6 дней назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

I came here from the author's X post

»
6 дней назад, # |
  Проголосовать: нравится +103 Проголосовать: не нравится

As a tester, I tested the round.

»
6 дней назад, # |
Rev. 2   Проголосовать: нравится -6 Проголосовать: не нравится

As a tester, I ate 2 bags of chips while testing.

  • »
    »
    5 дней назад, # ^ |
    Rev. 5   Проголосовать: нравится +81 Проголосовать: не нравится

    As your sincere friend and a member of the_coding_pooh 's fan club, I wish you stop emoing and go find a better life. Chips only make you as fat as me!

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

    Friendly advice: chip crumbs can greatly stain/dust your keyboard, especially so if that was a mech key. Stress snacking is okay but don't let them damage your own equipments.

»
6 дней назад, # |
  Проголосовать: нравится +23 Проголосовать: не нравится

Misuki orz

»
6 дней назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

interactive problems..cool

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

Hope to reach -110 after this.

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

Who told them to say 1 or more interactive instead of 0 or more :)

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

Let's do our best

»
5 дней назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится

As a tester, I can confirm that the round is supercalifragilisticexpialidocious, too.

»
5 дней назад, # |
  Проголосовать: нравится +37 Проголосовать: не нравится

Good luck to everyone, and orz to Misuki!

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

Hope to reach 1300+ rating and solve ABC!

»
5 дней назад, # |
  Проголосовать: нравится +80 Проголосовать: не нравится

As a tester, I recommend solving AtCoder problems if you want to be as good as Misuki!

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

What does the score distribution mean?

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

    if you solve the 1st problem at exactly 0 minutes after the contest started, you will get 500 points, for the 2nd problem 1000 points, etc.. over time the points that you get per problem decreases, so these values are not constant.

»
5 дней назад, # |
  Проголосовать: нравится +28 Проголосовать: не нравится

As a tester.. i hope everyone get positive delta..

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

hope for new color

and hope for Salah7_a

»
5 дней назад, # |
Rev. 2   Проголосовать: нравится -8 Проголосовать: не нравится

Hope back to blue man :)

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

After getting down by the allegations of CHEATING, still standing to become RED

»
5 дней назад, # |
  Проголосовать: нравится +21 Проголосовать: не нравится

As a tester, i did nothing

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

I think this round will be great.

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

Hopefully, the color of my username will change

»
5 дней назад, # |
  Проголосовать: нравится -27 Проголосовать: не нравится

ill solve ABCDEF , ggez

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

    The contest will last for 2 hours with 5 tasks for you to solve, and 1 task will have subtasks. The contest will only be rated for those with a rating not higher than 2099, but higher rated users are also more than welcome to participate out of competition. There is at least one interactive problem, so please read the guide for interactive problems if you are unfamiliar with them.

    please read it.

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

    I think you are referring to E2 as F. problem E got subtasks so it would be labeled as E1 and E2, rather than E and F.

»
4 дня назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

As a participator, Thankyou for Interactive problem ❤️

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

As a participant all the best to all my fellow coders

»
4 дня назад, # |
Rev. 2   Проголосовать: нравится -9 Проголосовать: не нравится

.

»
4 дня назад, # |
  Проголосовать: нравится -10 Проголосовать: не нравится

I want to get +2500 in this contest

»
4 дня назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

there is at least one interactive problem

it's so over

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

hope cadidate master today:3

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Why did a game a long time ago change from scoring to not scoring, and the questions passed were also displayed as skipp

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Why did a game a long time ago change from scoring to not scoring, and the questions passed were also displayed as skipp

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Thanks to everyone who make this contest happen! Let's go!

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

ready for another opportunity to come back to cyan :)

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Interactive Problems after a long time...

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hope to reach Specialist after this contest.

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Misuki so strong!!!

Giving a contest after almost 2 months, hope I don't get destroyed..

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

Misuki

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I really want to participate in it,but it's a pity that I don't have time...

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I hope to solve A,B,C

»
4 дня назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

so orzful for this contest <3

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

interactive problem will have two subtasks most likely

»
4 дня назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится

Taiwanese? I had to participate!

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

With a heavy heart and determined spirit, I'm back for higher +ve deltas

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

It can be a big challenge for my to solve interactive problems. But I have to try my best because I don't want to find my Rating going down again after the competition. It's really depressing!

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hope to slove A,B,C and D.

»
4 дня назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

wish I could become 1200 rating after this contest!

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hope to accept A, B and C

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

As a tester, I did not test the problems.

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Wish me to boost my rating in this round. And Good Luck Friends!

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Going to participate after almost a year, let's see what happens.

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Couldn't join the contest for 15 minutes. Am I the only one experiencing this?

»
4 дня назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

Why is C of trees I am gonna be Pupil again

»
4 дня назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

Poorly written B.

»
4 дня назад, # |
  Проголосовать: нравится -7 Проголосовать: не нравится

Absolutely LOVED C! Took me a lot of time, but that was SATISFYINGGGG

»
4 дня назад, # |
  Проголосовать: нравится -13 Проголосовать: не нравится

is it just me who thinks they should have mentioned the word cirular array in A to make things clear. I was breaking my head thinking how 8 8 7 6 3 8 7 6 3

can be convert to equal array

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Could only solve one.

»
4 дня назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Got humbled by C so hard, speedran A+B in 10 mins feeling positive, just to get completely stuck on C with -7 at 15 mins left and no clue how to proceed

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

    B took me a while (I jumped to C before solving B) (I hated the way it's written), but for C, for me atleast I thought this way: let's root the tree at 1, this way for every other vertices, there is a segment between the 1 and that vertice right? okay now suppose you query the x between a and another vertice, for sure it's in the middle right? so for every line in the tree starting from 1 as a root and you query 'b' for example, now you can solve for the segment a,b recursively, solve(a,b)={ if ask(a,b)==a -> a line between a and b, otherwise ask(a,x),ask(x,b)} now suppose that there is a segment like this 1 — 2 — 4 — 6 — 8 — 9 and you queries solve(1,6) so you have all the segment 1,2,4,6 next time ofc you ll not query something that you constructed before so hold a visited state ! , say next time you ll query for solve(1,8), I claim that to solve(6,9) you ll get to this solve in log(the length of the segment) why? because you gonna ask(1,8) and you ll get 4 but you already constructed 4 right? so now don't ask solve(1,4),solve(4,8), just solve(4,8) => segments gets to half eatch time so it 's a log. and we have 15*n queries , max of our log is 10 as n is 1000

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

      This was the first thing I wrote, but I probably messed it up somehow, because I would get -1 on test 3. Spent around an hour trying to find where the program fails before trying to figure out how to approach the problem differently (with no results)

      bool dp[1001][1001];
      vector<vector<int>> e;
       
      void recurse(int n1, int n2) {
          if (n1 == n2) return;
          if (dp[n1][n2]) return;
          dp[n1][n2] = true;
          dp[n2][n1] = true;
          int a;
          cin>>a;
          if (a == n1 || a == n2) {
              e[n1].push_back(n2);
          } else {
              recurse(a, n1);
              recurse(a, n2);
          }
       
      }
       
      
      • »
        »
        »
        »
        3 дня назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        you missed the binary search aspect,

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

          Not gonna lie, it took me like 4 hours to finally understand how the solution works, even after looking at like 5 different explanations. It's so simple, idk why it was so hard to see

»
4 дня назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится
A
B
C & D
»
4 дня назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Stuck on WA 3 for D, can anyone share some small/tricky testcases?

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

finally changed colors!

»
4 дня назад, # |
  Проголосовать: нравится -26 Проголосовать: не нравится

Worst contest ever

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

problem C is cute problem I think, didn't realize binary_search can be used in such way until very last minute.

but I still cannot believe how 5000 people come up with solution in time. like how this problem have rating difficulty of 1500?

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

    I didn't use binary search at all.

    Simple recursion with DSU: https://codeforces.com/contest/2001/submission/277397822

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

      can u explain it sir

      • »
        »
        »
        »
        3 дня назад, # ^ |
        Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

        In fact, it is very similar to editorial solutions.

        For each pair of nodes i and j that are not currently in the same component (I used DSU for this, but a simple visited array will also suffice), we do the following recursion (v1=i, v2=j on the beginning):

        • Find the closest node using the ? query.

        • If it returns one of our nodes, then we can union the two components together since they are directly related.

        • Otherwise, we know some node that is in the middle of our nodes, so we can call the recursion with (v1, mid) and (v2, mid). So at the end of such a recursion (v1, v2) will be in one component (v1 in the same component with mid; v2 in the same component with mid => v1 and v2 in the same component).

        I didn't think much about the count of used queries, but I assume it's O(n).

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

    I believe solution would have been leaked somewhere ;)

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

knew i was cooked as soon as i saw A

and i was, time to return to pupil ! yayy

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

need 2 more minutes for D :(

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I am so dumb that 17k solved B and i didn't even understand the question until now :(
Someone please explain the problem statement.

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

    you have an array of numbers from 1 to n, lets call it arr, and an array of -1s, lets call it res. you can start from either side of res(the start or the end), and you can also return to the side from which you started. you can also move towards the side that you didnt start at. you can place the smallest number in arr at the position you are at, and you can do that until arr is empty, and res is full. construct the array res, so that from whichever end you start, if you do the operations in an optimal way, the amount of return operations to the starting side, is equal. i hope i clarified it a bit, and i can give solution too if you want.

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

      Could you please take n = 5(say) and explain the problem with it, like an example. The explanation given along with the problem was literally very bad!

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

        for n = 5 I tried it on copy and come up with 5 3 1 2 4 as a solution and saw the pattern and coded it

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

          Could you explain how you approached?

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

            I was trying hit and trial as I was not able to understand when I need to return carriage approach was like if I need equal permutation from both the typewriter with equal carriage being used then for first typewriter when I move left then I need carriage and for the second typewriter I move right I need carriage so for making it equal I need to do it from middle only which is possible for only odd n and not for even n

»
4 дня назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

C was fun. First time trying out an interactive problem.

»
4 дня назад, # |
  Проголосовать: нравится +17 Проголосовать: не нравится

It took me more time to understand problem B than it took to actually solve it

»
4 дня назад, # |
  Проголосовать: нравится +26 Проголосовать: не нравится

Huge praise on C. I'm glad that I didn't have to do the binary search myself today (and pushed the heavy job to the interactor).

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

    lol

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

    could you explain C, i am clueless about trees, so i just skipped it and solved D instead

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

      Pivot a random node (in this case I'll use $$$1$$$) as your "root". Traverse each and every other node (denoting the traversing node $$$i$$$), and perform the following:

      • Set $$$l = 1$$$.
      • Ask for $$$(l, i)$$$ and retrieve $$$x$$$. If $$$x = l$$$, conclude that there exists an edge between $$$l$$$ and $$$i$$$, then go to the next node. If not, set $$$l := x$$$.

      The catch here is that we'll use the interactor to binary search for us to reach a stray node's "parent". We'll finish the tree structure when all nodes found their parents (except for $$$1$$$, as it's pivoted as root).

      Total query count should be approx. $$$10n$$$.

»
4 дня назад, # |
  Проголосовать: нравится +20 Проголосовать: не нравится

Once again, D got leaked on a certain "YouTube channel" (as expected), with about 1k views in just one hour before the contest finished :)

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

    that's so fucked. I wonder if there's anything we can do about it

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

    gotham needs batman

  • »
    »
    3 дня назад, # ^ |
      Проголосовать: нравится +13 Проголосовать: не нравится

    Can we just mass report this one YT channel so that we don't have this many cheaters? (Honestly, I don't really want to mention it because there is a probability that someone will use it to cheat in future rounds)

»
4 дня назад, # |
Rev. 2   Проголосовать: нравится +10 Проголосовать: не нравится

The statement of B is very bad. Lots of cheating again (near 5k official solved C).

»
4 дня назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится

In Problem B, if there are 3 different operations, and you ask us to minimize just one of them, at least highlight it please?

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

My implementation skill is getting worse and worse.

»
4 дня назад, # |
  Проголосовать: нравится +15 Проголосовать: не нравится

Hints for D. Longest Max Min Subsequence

Consider the first index where an element appears for the last time. Since this is your last chance to take this element, you have to construct the best sequence that you can using the elements to the left. Hence, greedily take big and small elements to the left (while ensuring that as soon as you take an element, you invalidate all its left neighbors). Then, if you have taken an element, you can say that this element will never contribute to the last occurrence anymore.

Hence, you greedily take elements at each last occurrence of alive elements.

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

ayy just look at rank 1166 , tanish-jindal his D solution hahahah, just blatant cheating with stupid variable names

»
4 дня назад, # |
  Проголосовать: нравится +25 Проголосовать: не нравится

Watch out for these leaked solutions

Problem C
Problem D
Problem E1
»
4 дня назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Deleted

»
4 дня назад, # |
Rev. 3   Проголосовать: нравится -21 Проголосовать: не нравится

B is the stupidest problem I have seen so far. Does providing enough test cases to understand the problem cost money? I hope you guys never set a question like this again. This kind of contest ruins my whole excitement toward contests.

  • »
    »
    3 дня назад, # ^ |
      Проголосовать: нравится +7 Проголосовать: не нравится

    They don't provide too many test cases because then you could deduce a pattern. In this case it would be easy to guess that it doesn't work for n even.

  • »
    »
    3 дня назад, # ^ |
    Rev. 2   Проголосовать: нравится +35 Проголосовать: не нравится

    I actually hated it when they included the 3rd sample into B just to soothe your nagging mouths. Do you guys ever test the inputs yourself? Doubly so when it's a constructive and the process of checking correct answer is easy?

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

      Sorry, my bad. I shouldn't have said it was easy, but the way it was written made it hard to understand. Maybe it's because I'm a beginner, but a lot of participants faced the same problem. You can ask them.

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

        I will simply tell you guys to stay away from keyboard, take a pen and a notebook, and do your thinking there. You all failed to sustain when problemsetters didn't overfeed like they usually do is not an indicator of a bad problem.

        I did casually curse the original sample "they really did it cheeky there huh?", but the course of actions of drafting my own work only took me about 2 minutes after, and got an AC at 7:xx.

        Did I stumble? Yes.

        Did I resolve myself? Yes.

        Did I underperform myself? Yes. (7:xx to AC problem B is slow)

        Should I blame the setters? No.

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

          I also did stumble at B but got it resolved myself with pen and paper and too hated when they added new test at B which made it super easy. It was super slow for me to solve B as I didn't understood the problem in starting which affected my rankings.

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

Edit: Nvm, just my stupidity.

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Worst Problem E1 & E2 I have seen, can't believe there exists a problem worse than "Let Me F**k you a Lesson". Downvoted.

»
4 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How do I approach C?

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

    Use the fact that the query tells you the middle node on the path between nodes $$$a$$$ and $$$b$$$, that should hint at a certain technique.

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

    hint 1- assume any node to be root of tree 2) — if u have any child parent pair in query than answer will either be child or parent just try to generalize this fact.

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

Can anyone post their solution to C. I speed ran A, B but got stuck for 1 hour and 45 minutes on C

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

    You can solve it using binary search. I did it by having i go from i to n — 1, and then querying ? i n. Since the x node is going to be in the middle of both nodes we can now keep querying ? i x until the the middle node isn't equal to i. When it is we know that he nodes we queried are connected by an edge since the middle node is one of the nodes we asked about. My submission that has some code that isn't really useful looking back: 277383795

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

i would recommend that before the operations description in problem B say that we will chooce one of them

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I think div2 is getting harder and harder

»
3 дня назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится

D is on obvious side than its position, but C is very cool! Thanks for an interactive which feels brand-new!

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Interesting problems that require some tough thinking. Love this round!

»
3 дня назад, # |
  Проголосовать: нравится +16 Проголосовать: не нравится

Let's fucking go guys, can't wait for the next contest for people to sell and leak even more solutions!

Images on codeforces are retarded today, can't embed, so here's an album

https://imgur.com/a/RNHSRp4

4eRRKghr p013lPh7

So there's like at least one or two IM-GM's selling solutions right now. Understandable, have a nice day.

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

why i get idleness limit exceeded 277414909 even if I fflush the output, can anyone help me.

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

    same bro

  • »
    »
    3 дня назад, # ^ |
    Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

    When you're outputting the answer, you are missing a space after the exclamation mark ("!1 2 1 3 3 4" instead of "! 1 2 1 3 3 4"). This probably confused the system.

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

      ohh my bad, i am sorry I will try again thank you for finding my mistake

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

        Looking in your code again, you're also missing a newline after outputting the answer, which is probably problematic as well. Be VERY careful with output formatting, especially in interactive problems.

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

    I was getting idleness exceeded too if I didn't do 'cout << endl'; Try printing a newline or using endl after you query. It should work

»
3 дня назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

just a 2 min research

277417188 imagine working to get in IITB and then it still comes down to cheating? , 277406374, 277417238 bro really did the hardwork for converting to python lmao, 277411216 this dude interchanged for loops and while loops, 277408155

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

    bro idk how did u find and check these submissions

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

      i basically go into standings for the round. Then i simply look at newbies and pupils who have solved 4 that too in the last 30 minutes. Then codeforces allows you to open the submissions once the contest is over, so i check the submissions and match with the leaked ones.

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Problem A felt like there was something to it, but the more I thought about it the realization came in: "Ahh.. it's just a trivial problem that was deliberately given a weird statement to confuse AI, isn't it?". It made me kinda dislike the problem, sorry.

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

Bad Sample Cases

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I kept on getting Idleness Limit Exceeded on my Python solution to C, even though I flushed the buffers as required. Can anyone look through my solution and tell me what's wrong? SUBMISSION to C

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I think that an implementation with segment tree should have worked for D. The time limit is too small. 277416972

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

    what is the time complexity of segment tree? i think intended solution was O(n) and O(nlogn) probably passes as well.

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

      Theoretically, log(n) for each update and query at each position, so n * log(n). Practically, I know it's a very large constant, but 2s seems a bit low for D.

»
3 дня назад, # |
  Проголосовать: нравится +31 Проголосовать: не нравится

going through the scoreboard and found a bunch of similar solutions for E1. Here are just a few.

There are so many that I'm tired of looking at them all.
»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I find some of the statistics about the round... interesting.

»
3 дня назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

I hate interactive questions

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Do anyone know a software that have a faster execution for interactive problem?

I use jdoodles but it not stable

»
3 дня назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится
»
3 дня назад, # |
  Проголосовать: нравится +23 Проголосовать: не нравится

Cheatforces...

»
3 дня назад, # |
  Проголосовать: нравится +40 Проголосовать: не нравится

Hi guys, I am very sorry for the situation with B. It was not an easy task to explain and we got lots of clarification requests during the round. I know I should not have added an example case in the middle of the round, but I felt like it was better to have everybody understand the statement (with, some may say, an advantage for people who solved B later) rather than having an unclear problem. I take full responsibility for what happened and will make sure to not make it happen again.

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

    I think the PS for B just had the issue that I thought we had to do the operations in some order. Instead of us doing anything.

    Other than that I loved the problem idea.

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

really nice problem C

trick
  • »
    »
    3 дня назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    could u explain more clearly

    • »
      »
      »
      3 дня назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится
      explanation

      if you have any more questions try executing my code step by step

»
3 дня назад, # |
  Проголосовать: нравится -8 Проголосовать: не нравится

Today Problem C was Solved by Chat-GPT, here is the link to the convo: You can Match this to my submission, Really Disappointed by this discovery I want to report contest violation on myself and want the Testers to do better , I did this as a joke today but some people regularly use ChatGpt to solve problems upto D, This is ridiculous please make sure the contest are fair please look into it. Misuki MikeMirzayanov Ahmad_OS BurnedChicken

»
3 дня назад, # |
  Проголосовать: нравится +23 Проголосовать: не нравится

As usual, there are a lot of cheaters, but this time at least problems D and E require enough of implementation to detect cheaters.

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

Hi, i have a query regarding segment tree,i submitted two solutions for D-277405401 and 277409915,first one gives "Runtime error" and second one is accepted,the only difference between them is the memory i allocate to segment tree.

I read than size of segment tree is less than 4*(size of array) then why does my first submission fail.Any help is appreciated.

HELP!!!!

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

cool round, had a lot of fun participating after such a long break! cheers to the problemsetters and testers! <3

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Can someone tell me why I get WA on test case 3 for my solution to C: Code

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

The problems were interesting! Thanks for the round!

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

Can anyone tell why my solution gave a runtime error in pretest 3?

277417034

I used the fact that if the answer to "? a b" is a then they have to be adjacent in the tree.Whenever the answer was different from a, then i would know that the path which connects them goes through another node x and therefore i would have to ask "? a x" and "? b x". I used dsu to avoid doing unnecessary questions. I suspect the dsu might be the reason for the RE but i cant spot the mistake

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Can someone tell me why my submission: https://codeforces.com/contest/2001/submission/277402454 is giving a wrong output format Unexpected end of file - int32 expected (test case 1) error?

It passes on everything else...

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

    You call ios_base::sync_with_stdio(false), which means output buffers of stdout and cout aren't synchronized. You should just use cout.flush(), not fflush(stdout). Once you call ios_base::sync_with_stdio(false), only use cout and don't touch stdout.

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Thanks Misuki ,Really enjoyed solving c problem. but i am suprised so many people solved it. Too much cheating

»
3 дня назад, # |
Rev. 3   Проголосовать: нравится +1 Проголосовать: не нравится

For someone looking for an elegant implementation of problem C,

My Code

The idea is to fix 1 as the root. Then we need to find the parent of every i(2,N).

The observation is that every time we query(a,b), x points to the midpoint of (a,b). This gives us the intuition of binary search considering the number of allowed queries. An edge exists from (a,b) when query(a,b)=a.

The above observations are sufficient to solve the problem.

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Can someone please explain why is it failing on test case 3 (wrong output format)? I basically check for valid pairs of nodes, and return when a from query equals the nearest node.[submission:277424402]

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

The data of D is too weak. Some people passed it by going through every value each time, which can have a complexity of $$$O(n ^ 2)$$$

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

In problem C when I use fflush(stdout); I got "Idleness limit exceeded" but when I use cout.flush(); it gives correct answer. Why? I used language "C++20 (GCC 13-64)". 277431865 277431666

»
3 дня назад, # |
Rev. 3   Проголосовать: нравится +8 Проголосовать: не нравится

Only at upsolving I realized I was so close to AC E1. I somehow tried to calculate the losing side by pure power instead of stars-and-bars, and scrambled my hair at why test 2+3 was WA. What an idiot I was.

AC upsolve: 277433539 ( UPD: changing to a cleaner/no-debug code)

Kudos for the round, it was nice. I wish I could see more from you soon.

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

    I'm doing the same thing, but I can't understand why the losing side needs stars and bars, can't I pick any node from that subtree for each operation?

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

      You got it right, but the stars-and-bars are to correctly count them.

      What you should count is basically "for a complete binary tree of $$$2^i - 1$$$ nodes, how many distinct heaps are there after adding $$$k_0$$$ operations into it". Since we discern by heap values, $$$\left( 2^i - 1 \right) ^ {k_0}$$$ is obviously wrong.

    • »
      »
      »
      47 часов назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

      because each operation is indistinguishable, so you should use star and bar to calculate it (i.e. the number of ways to put $$$a$$$ indistinguishable balls into $$$b$$$ distinguishable slots). $$$b^a$$$ is used to calculate the number of ways to put $$$a$$$ distinguishable balls into $$$b$$$ distinguishable slots. And it's important to think the objects are distinguishable or indistinguishable in counting problems.

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

The data of problem D is so weak that someone can solve it by solution of O(n^2);

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

As the guy that got 4th I just now realised my solution to D runs in O(n^2) :skull:

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

277408206

This submission by user rajneesh_neo clearly seems to be faulty ..

it clearly has been copied from 277400319 by user keyur14113

using some AI tool , just the variable names have been changed.. rest of the structure remains exactly same..

Kindly look into this MikeMirzayanov

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Please can someone help me with why I'm getting Idleness limit exceeded for this code?

from sys import stdin, stdout
input = lambda: stdin.buffer.readline().decode().strip()
flush = stdout.flush
vis = set()
def explore(x, y):
    if f'{min(x, y)} {max(x, y)}' in vis:
        return ''
    vis.add(f'{min(x, y)} {max(x, y)}')
    print(f'? {x} {y}'); flush()
    new = int(input())
    if new == x:
        return f' {x} {y}'
    left = explore(x, new)
    right = explore(new, y)
    for a in left.split():
        for b in right.split():
            vis.add(f'{min(a, b)} {max(a, b)}')
    return left + right

for _ in range(int(input())):
    n = int(input())
    ans = ''
    for i in range(1, n+1):
        for j in range(1, n+1):
            if f'{min(i, j)} {max(i, j)}' in vis or i == j: continue
            ans += explore(i, j)
    print('!' + ans); flush()
»
3 дня назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

Yay !! Thanks for the interactive problem authors..Hoping to reach cyan in the next contest

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

I am a newbie .. i did only one question in this contest and that too correct but i lost -31 .. can anyone tell how ?

  • »
    »
    3 дня назад, # ^ |
      Проголосовать: нравится +6 Проголосовать: не нравится

    Your Rating depends on your performance on that given contest like if you performed like a 800 you would certainly get a positive rating but if your performance is less than your current rating then your will lose some rating .You can Calculate your performance by seeing the number of submissions on a given problem like for today's contest Many people solved the A problem so to get a positive rating you must solve problem A fast or solve at least 2 aside from that there is an extension called carrot try using that it does a great job predicting the rating changes..

    Happy Coding !!

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

      Thanks got it got it .. thanks ;

      • »
        »
        »
        »
        3 дня назад, # ^ |
          Проголосовать: нравится +6 Проголосовать: не нравится

        One more Thing you seem to only solve problems of 800 rating but I would suggest leveling up a bit because that will not be enough to solve the B of div 2 which is bad in a long run so do try out problems of rating 900 or 1000 more...

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone tell me why my code for D got accepted with time complexity of O(n²)?

Is there any data could hack my solution: 277446088?

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Can someone tell me,Why i got 40+ in last contest even though i didn't attend able to do 1st first in time? AND why i got only 15+ from this contest by only solving 1st question??

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

    As a newcomer, you have 1200 hidden initial ratings, divided into the first five contests sent to you. If you don't perform well in the first 5 contests, the rating sent to you will be reduced, but you will not be given negative ratings. The following contests after first 5 contrsts will directly settle your total rating. So all in all, instead of going up to 783, you're going down from 1200 to 783.

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Previous div 2 round : solved 2 problems with no penalty -> rank 5157 This div 2 : similarly solved 2 problems in similar time with no penalty -> rank 11650 What happened here lol

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

in problem c why it was not mention tree has n--1 edges exactly i struggled a lot like 30 min

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

the worst problems set that i've ever seen

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

Really nice interactive problem,which made me -152 :(

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Can someone tell me where am I failing,my max no of queries are less than 15n but I am failing. My logic is somewhat similar to editorial Here is my solution 277462404

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I submit twice on problem C.the first one at 00:38:35 and the second one at 01:51:32.The first one get skipped and my ac time become the second one?? I dare not to submit twice again...

  • »
    »
    3 дня назад, # ^ |
      Проголосовать: нравится +6 Проголосовать: не нравится

    Do not resubmit in normal rounds unless you have high doubt in your previous solution. But you can resubmit as much as you want in Educational, or Div. 3/4 rounds.

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

      I didn't use fast IO in the first solutioin so I want to see how fast it will be if I use fast IO... I will not resubmit anymore. Thanks for the explaination.

»
3 дня назад, # |
  Проголосовать: нравится +17 Проголосовать: не нравится

C was insanely good. Kudos to the authors!

»
3 дня назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

ORZ

»
2 дня назад, # |
Rev. 31   Проголосовать: нравится +2 Проголосовать: не нравится
`How many of you agree that`**cheating**`has increased so much on Codeforces?`  

_____________________________________________________________________________________

The Codeforces management should investigate the apparent increase in cheating on their platform.

_ Some important points which I think will be helpful._

1.Analyze data and metrics to quantify the extent of the cheating problem. This could involve looking at suspicious activity, sudden spikes in ratings, unusual submission patterns, etc.

2.Evaluate the effectiveness of their current anti-cheating measures and determine if additional safeguards or detection methods are needed.

3.Clearly communicate their stance on cheating and the consequences for offenders to deter future incidents.

4.Collaborate with the competitive programming community to gather insights and feedback on the best ways to maintain the integrity of the platform.

_ Addressing cheating concerns proactively and transparently will help Codeforces maintain its reputation as a fair and competitive programming environment. Decisive action by the management could go a long way in preserving the platform's credibility._

_____________________________________________________________________________________

»
44 часа назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

My solution 277403863 for the problem 2001C(aritg). I had done the question earlier than the second person whom I don't know. So, why did I get that it matched with someone.

»
41 час назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I have been informed that my solution for problem D matches with many others . I don't know how it happened but I want to clarify that my solution is completely my work . So, I request you to look over my situation in this . Also, on codeforces it is happening to me for the first time.

»
38 часов назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

I have been wrongly accused of cheating even though my submissions our genuine. I request to look into it and make way for my truthful submissions. This is the first time it’s happening to me and also I have submitted the solutions earlier than the other persons.

»
37 часов назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Me: lets try to become specialist

CF: final rating= 1399