Hello 2026 Editorial

Правка en14, от wangmarui, 2026-01-07 19:41:48

We'd like to thank you all for participating in the contest, and hope you enjoyed it. Any feedback would be appreciated!

Rate The Contest!

2183A — Binary Array Game

Rate The Problem!
Hint 1
Hint 2
Solution

Time complexity: $$$O(\sum n)$$$.

2183B — Yet Another MEX Problem

Rate The Problem!
Hint 1
Hint 2
Solution

2183C — War Strategy

Rate The Problem!
Hint 1
Hint 2
Hint 3
Claim 1
Proof
Claim 2
Proof
Solution
Bonus

2183D1 — Tree Coloring (Easy Version)

Rate The Problem!
Hint 1
Hint 2
Solution

2183D2 — Tree Coloring (Hard Version)

Rate The Problem!
Hint 3
Solution

2183E — LCM is Legendary Counting Master

Hint 1
Hint 2
Hint 3
Hint 4
Solution

2183F — Jumping Man

Hint 1

Hint 2

Hint 3

Hint 4

Solution

Let $$$f_{i,j}$$$ represent the number of ways to choose two strings located at nodes $$$i$$$ and $$$j$$$, respectively, within their subtrees. Clearly, $$$f_{i,j}$$$ has a non-zero value only if $$$c_i = c_j$$$, where $$$c$$$ denotes the string sequence.

Then, $$$f_{p,q}$$$ contributes to $$$f_{i,j}$$$ if and only if $$$p$$$ is in the subtree of $$$i$$$ and $$$q$$$ is in the subtree of $$$j$$$. By performing a depth-first search (DFS) on the tree and marking timestamps, the $$$(dfn_p, dfn_q)$$$ pairs of contributing $$$f_{p,q}$$$ must form a rectangle. Sorting by $$$dfn$$$ and computing suffix sums suffices.

The time complexity is $$$O(n^2)$$$.

Spoiler

Solution

It can be observed that the sizes of the sets returned after querying \texttt{L} and \texttt{LR} are the same. The proof is as follows: After querying \texttt{LR}, the positions of the surviving snakes are exactly their initial positions. Since the relative positions of all snakes remain unchanged, operating \texttt{R} after \texttt{L} will never cause two snakes to collide. Hence, the sizes of the returned sets are identical.

By establishing a one-to-one correspondence with the initial coordinates, we can easily deduce the speeds of all snakes that survive after querying \texttt{L}.

At this point, we only lack the speeds of the snakes that died after querying \texttt{L}. A simple case analysis reveals the following scenarios (where the first number on the right represents the speed of the snake that died after querying \texttt{L}, and ``_'' indicates no snake at that initial position): \begin{itemize} \item \texttt{01} \item \texttt{02} \item \texttt{0_2} \item \texttt{12} \end{itemize}

These cases can be resolved through direct casework, though the implementation may be somewhat cumbersome. Therefore, we consider a more concise approach.

First, we aim to determine the speeds of some snakes with speed $$$2$$$. For the position and speed of such a snake, the following cases allow direct determination: \begin{itemize} \item The previous snake is at a distance of $$$1$$$ and has a confirmed speed of $$$1$$$. \item The previous snake is at a distance of $$$1$$$ and has an unconfirmed speed. Here's why the speed of the current snake is determined in this case: \begin{itemize} \item If the previous snake's speed is $$$0$$$, it will definitely not be killed in a collision, so this scenario is impossible. \item If the previous snake's speed is at least $$$1$$$, then the current snake must have a speed of at least $$$2$$$ to collide with it. Thus, the current snake's speed is at least $$$2$$$. \end{itemize} \item The previous snake is at a distance of $$$2$$$ and has a confirmed speed of $$$0$$$. \end{itemize}

The above casework naturally excludes the scenarios \texttt{0_2} and \texttt{12}.

Now, only the cases \texttt{01} and \texttt{02} remain. It can be observed that the only indistinguishable scenarios are \texttt{010} and \texttt{020}. Therefore, we can initially disregard such cases, first find a valid solution, and then check whether this solution exhibits such a scenario.

Otherwise, since the snake immediately after the current one has a speed of at least $$$1$$$ (in cases with a unique solution), the position this snake would reach after moving without obstacles is exactly the position of the first snake whose position is $$$\ge$$$ the current snake's position after querying \texttt{R}. If this snake does not encounter any other snake while moving right, its position can also be directly determined. Thus, we can use this method to determine the speeds of all snakes.

Time complexity: $$$O(\sum n)$$$ or $$$O(\sum n \log n)$$$.

Spoiler

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en49 Английский Hoks_ 2026-10-17 07:06:11 0
en48 Английский Hoks_ 2026-10-17 07:06:11 0
en47 Английский Hoks_ 2026-10-17 07:06:11 18581
en46 Английский Network_Error 2026-02-10 13:13:17 187
en45 Английский Network_Error 2026-01-12 12:28:19 10
en44 Английский Hoks_ 2026-01-10 01:14:14 33
en43 Английский Hoks_ 2026-01-08 19:44:43 90
en42 Английский Hoks_ 2026-01-08 19:42:41 5773
en41 Английский Hoks_ 2026-01-08 19:23:09 5
en40 Английский jiazhichen844 2026-01-08 14:26:48 34
en39 Английский jiazhichen844 2026-01-08 14:22:29 1772
en38 Английский Network_Error 2026-01-08 05:17:37 42
en37 Английский Network_Error 2026-01-08 05:14:39 15789
en36 Английский Network_Error 2026-01-08 04:56:42 9006
en35 Английский Gold14526 2026-01-08 04:41:47 2
en34 Английский Gold14526 2026-01-08 04:38:43 7455
en33 Английский wangmarui 2026-01-07 22:46:47 8356
en32 Английский Proof_by_QED 2026-01-07 22:36:47 43211
en31 Английский wangmarui 2026-01-07 22:27:57 1 (published)
en30 Английский wangmarui 2026-01-07 22:23:28 1034 (saved to drafts)
en29 Английский Proof_by_QED 2026-01-07 21:42:10 121
en28 Английский wangmarui 2026-01-07 21:21:36 0 (published)
en27 Английский wangmarui 2026-01-07 21:20:38 290
en26 Английский wangmarui 2026-01-07 21:13:28 607
en25 Английский wangmarui 2026-01-07 20:49:13 2
en24 Английский wangmarui 2026-01-07 20:47:49 4
en23 Английский wangmarui 2026-01-07 20:43:38 5082
en22 Английский wangmarui 2026-01-07 20:26:14 99
en21 Английский wangmarui 2026-01-07 20:10:32 2715
en20 Английский wangmarui 2026-01-07 20:02:52 3269
en19 Английский wangmarui 2026-01-07 19:51:56 3
en18 Английский wangmarui 2026-01-07 19:50:44 798
en17 Английский wangmarui 2026-01-07 19:49:40 86
en16 Английский wangmarui 2026-01-07 19:44:57 809
en15 Английский wangmarui 2026-01-07 19:42:59 1307
en14 Английский wangmarui 2026-01-07 19:41:48 3144
en13 Английский wangmarui 2026-01-07 19:35:39 1315
en12 Английский wangmarui 2026-01-07 19:32:59 2170
en11 Английский wangmarui 2026-01-07 19:30:06 3252
en10 Английский wangmarui 2026-01-07 19:25:03 978
en9 Английский wangmarui 2026-01-07 19:16:31 27 Tiny change: 'oiler>\n\n## [C. War Strategy]()\n\n<spoil' -> 'oiler>\n\n<spoil'
en8 Английский wangmarui 2026-01-07 19:14:29 4380
en7 Английский wangmarui 2026-01-07 19:10:53 92
en6 Английский wangmarui 2026-01-07 19:06:05 1039
en5 Английский wangmarui 2026-01-07 16:56:42 199
en4 Английский wangmarui 2026-01-07 16:56:13 125
en3 Английский wangmarui 2026-01-07 15:13:48 1 Tiny change: 'est: \n\n# [2183A &' -> 'est: \n\n## [2183A &'
en2 Английский wangmarui 2026-01-07 15:13:29 1204
en1 Английский wangmarui 2026-01-07 15:04:13 260 Initial revision (saved to drafts)