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

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

This is a discussion blog for the ICPC India Chennai regionals 2023.

Link — ICPC Chennai regionals 2023

Since most of the problems went unsolved, you can add your solutions in the comments or hints to the problems. Feel free to add your opinions about the contest.

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

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

Auto comment: topic has been updated by drath10 (previous revision, new revision, compare).

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

Could you order them by difficulty ?

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

For B, simple brute force with big int template works.

For A ( nothing concrete ), my thought process was that a trie and some preprocessing we could reach a string $$$s_i$$$ such that $$$s_x$$$ in the answer is a prefix of $$$s_i$$$ only $$$\sqrt{L}$$$ string would be considerable for $$$s_x$$$ using this, however I was not able to get anything further

For E ( nothing concrete ), I think it was observational

For F ( nothing concrete ), I think trying greedily increasing weights which increases the answer by least amount should work, however I was not able to prove it or even fast track this for finding which edge that corresponds to the minimum increase

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

I was the author of E and H and here is the model solution for E (Hex-Hopping Horsey):

First, 3-color the hex grid as below:

11 x 11 grid colored

It is not hard to see that in this coloring, the "short" horsey moves will always connect cells of the same color.

Then try to construct Hamiltonian paths/cycles joining all cells of a single color. For any given $$$n \geq 3$$$, you can always construct atleast $$$1$$$ Hamiltonian cycle and atleast $$$2$$$ Hamiltonian paths. Then break the cycle and connect its ends to one of the ends of each of the other paths using "long" Horsey moves to get a single Hamiltonian path visiting all cells. Two "long" moves are the minimum you need in any case. The following is an example of how to do it for an $$$11\times 11$$$ grid:

Hamiltonian cycle for green cells
Hamiltonian path for blue cells
Hamiltonian path for yellow cells
Merged Hamiltonian path

Notice that in the construction above, the first and the last cells are adjacent to each other. You can always achieve this for all valid $$$n$$$ by choosing the correct color for the cycle and the correct ends of the paths to join to the cycle.

You can observe that the pattern of the answer depends on the value of $$$n\bmod 3$$$. The following are examples of the construction for different values of $$$n\bmod 3$$$:

9 x 9 (n mod 3 = 0)
10 x 10 (n mod 3 = 1)
11 x 11 (n mod 3 = 2)

No answer exists for $$$n=2$$$ and you can hardcode the answer for small $$$n$$$ such as $$$n=3$$$. For the rest, you can follow the construction patterns.

Solution in C++