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

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

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. GouMah01
  3. rajer_that
  4. activedeltorre
  5. suuuuuu
  • Проголосовать: нравится
  • +420
  • Проголосовать: не нравится

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

Excited to see the problems! Misuki Kaey orz!

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

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

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

Misuki orz!!

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

Interactive problem

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

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

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

I came here from the author's X post

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

As a tester, I tested the round.

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

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

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

Misuki orz

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

interactive problems..cool

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

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

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

Let's do our best

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

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

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

Good luck to everyone, and orz to Misuki!

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

Hope to reach 1300+ rating and solve ABC!

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

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

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

What does the score distribution mean?

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

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

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

hope for new color

and hope for Salah7_a

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

Hope back to blue man :)

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

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

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

As a tester, i did nothing

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

ill solve ABCDEF , ggez

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

As a participator, Thankyou for Interactive problem ❤️

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

As a participant all the best to all my fellow coders

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

.

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

there is at least one interactive problem

it's so over

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

hope cadidate master today:3

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

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

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

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

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

Hope to reach Specialist after this contest.

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

Misuki so strong!!!

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

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

so orzful for this contest <3

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

Taiwanese? I had to participate!

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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!

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

Hope to slove A,B,C and D.

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

wish I could become 1200 rating after this contest!

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

Hope to accept A, B and C

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

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

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

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

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

Why is C of trees I am gonna be Pupil again

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

Poorly written B.

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

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится -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

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

Could only solve one.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 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

    • »
      »
      »
      2 года назад, скрыть # ^ |
       
      Проголосовать: нравится 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);
          }
       
      }
       
      
      • »
        »
        »
        »
        2 года назад, скрыть # ^ |
         
        Проголосовать: нравится 0 Проголосовать: не нравится

        you missed the binary search aspect,

        Spoiler
        • »
          »
          »
          »
          »
          2 года назад, скрыть # ^ |
           
          Проголосовать: нравится +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

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

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

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

finally changed colors!

»
2 года назад, скрыть # |
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?

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

knew i was cooked as soon as i saw A

and i was, time to return to pupil ! yayy

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

need 2 more minutes for D :(

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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.

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 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.

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

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

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

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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).

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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 :)

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

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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?

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

My implementation skill is getting worse and worse.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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.

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

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

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

Watch out for these leaked solutions

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

Deleted

»
2 года назад, скрыть # |
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.

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится +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.

  • »
    »
    2 года назад, скрыть # ^ |
    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?

    • »
      »
      »
      2 года назад, скрыть # ^ |
       
      Проголосовать: нравится 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.

      • »
        »
        »
        »
        2 года назад, скрыть # ^ |
         
        Проголосовать: нравится +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.

        • »
          »
          »
          »
          »
          2 года назад, скрыть # ^ |
           
          Проголосовать: нравится 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.

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

Edit: Nvm, just my stupidity.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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.

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

How do I approach C?

»
2 года назад, скрыть # |
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

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 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

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

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

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

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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.

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

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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.

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

Bad Sample Cases

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

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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.
»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

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

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

I hate interactive questions

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

Cheatforces...

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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.

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

really nice problem C

trick
»
2 года назад, скрыть # |
 
Проголосовать: нравится -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

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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.

»
2 года назад, скрыть # |
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!!!!

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

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

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

The problems were interesting! Thanks for the round!

»
2 года назад, скрыть # |
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

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

Can someone tell me why my submission: https://codeforces.me/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...

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 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.

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

      I'm a bit confused -- where do I use stdout? I thought doing cout<<endl was good enough?

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

        stdout is for C I/O and cout is for C++ I/O. Basically C++ I/O is good enough and you don't need to use C I/O at all. And once you call ios_base::sync_with_stdio(false), you shouldn't mix C I/O and C++ I/O.

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

          Gotcha. Thanks. But that wasn't the issue -- I think my code was just too slow, and the error it gives(wrong output format Unexpected end of file — int32 expected (test case 1)) is how they say "too slow" for interactive problems.

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

            endl isn't slow, and it should be possible to solve the problem with it.

            The message basically means your program quit without printing a required integer. Maybe ans in your code can be empty and your code prints just ! without numbers?

»
2 года назад, скрыть # |
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.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +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)$$$

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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

»
2 года назад, скрыть # |
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.

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 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?

    • »
      »
      »
      2 года назад, скрыть # ^ |
       
      Проголосовать: нравится 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.

    • »
      »
      »
      2 года назад, скрыть # ^ |
      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.

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

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

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

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

»
2 года назад, скрыть # |
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

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

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

»
2 года назад, скрыть # |
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 ?

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится +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 !!

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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?

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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??

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 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.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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

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

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

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

the worst problems set that i've ever seen

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

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

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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

»
2 года назад, скрыть # |
 
Проголосовать: нравится 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...

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

C was insanely good. Kudos to the authors!

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

Misuki orz

»
2 года назад, скрыть # |
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.

»
2 года назад, скрыть # |
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.

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

Me: lets try to become specialist

CF: final rating= 1399

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

Excited to see the problems! Misuki Kaey orz!