Comments
On wangmaruiHello 2026, 9 months ago
+88

This contest is good, but this author's reputation may not good...

On KANRounding 2025, 9 months ago
0

Thanks to all the teams responsible for competitions in 2025. Thanks for your hard work !

Looking forward to a more perfect competition in 2026!

Congratulations!You have done an amazing thing!

Maybe "no magic" is the magic of this year...

+5

Wish the competition goes smoothly

Nice job

Support. Unrated can provide a more authentic contest experience and will not conflict with other things about oneself.

The credibility of online contest rankings is decreasing, and our trust in "some users" is also decreasing.

It's really a bad thing.

Sorry for everyone.I said some negative comments yesterday.

Now I'm staying calm. The quality of this contest is good, and a good contest is also meant "Learning new knowledge".

I sincerely regret my mistake in yesterday's comment, can everyone forgive me once?

I think we can put classic questions like F on the practice list instead of in the competition?

A good contest is meant to enhance thinking and skills, not to expand knowledge.

I hope I add the conclution of Div1 C.

First, make $$$a_i=i$$$ is right.But how does the array b change?

Obviously, if the number $$$x$$$ becomes $$$y$$$, then find $$$i$$$ such that $$$b_i=x$$$, and change $$$b_i$$$ to $$$y$$$, which can be achieved by $$$O(n)$$$.

Next, Let $$$x$$$ choose, $$$y$$$ choose not(actually also $$$a_x$$$ and $$$a_y$$$).We will have two situations:

  • $$$x \lt y$$$ : We find $$$j$$$,$$$k$$$ such that $$$b_j=x$$$ and $$$b_k=y$$$.If $$$k \lt j$$$, we can know that this is impossible(If we want choose $$$y$$$, then we must choose array a until $$$k$$$. But $$$x$$$ is also chosen.). Similarly, we can know that $$$k \gt j$$$ is possible.

  • $$$x \gt y$$$ : We can choose $$$y$$$ first, so is possible both $$$k \lt j$$$ or $$$k \gt j$$$.

So, we can modify array b like this: If $$$b_j=x$$$, then let $$$Newb_x=j$$$.

Lastly, the array Newb is the array b mentioned in the solution ! We can copy the values from Newb to b.

This can explain why "For all $$$x\in S$$$, $$$y\in S$$$, if $$$x \lt y$$$, then $$$b_x \lt b_y$$$".

This is my code(Only the part of change array b):

    for(int i=1;i<=n;i++)M[a[i]]=i;
    for(int i=1;i<=n;i++)c[i]=M[b[i]];//change the b[i] first
    for(int i=1;i<=n;i++)b[i]=c[i];
    for(int i=1;i<=n;i++)c[b[i]]=i;//find b[j]=x and change Newb[x] to j
    for(int i=1;i<=n;i++)b[i]=c[i];//copy the values

I hope it can help someone!