Hello Codeforces!

We will host TOKI Open 2024. This is one of the tests to select the Indonesian team for IOI 2024. Everyone is welcome to take part in this contest.

The contest will be held in two days:

- Day 1: Saturday, 25 May 2024, 09:00 (UTC+7) — Sunday, 26 May 2024, 07:00 (UTC+7)
- Day 2: Sunday, 26 May 2024, 09:00 (UTC+7) — Monday, 27 May 2024, 07:00 (UTC+7)

Some key details of the contest:

- Duration: 5 hours
- Style: IOI
- Allowed language: C++17
- You can start at any time within the 22-hour window.

All contest days are hosted on TLX. Please register for an account if you do not have one. More details on the contest rules are available on the contest page.

The results will be published within one day after each contest day has ended.

We hope that you will enjoy the contest. Good luck and have fun!

**UPD.** The day 1 contest has ended. We have published both the scoreboard and the editorial, which can be found on the contest page. The day 2 contest window will start soon.

**UPD2.** All contest days have ended. Thank you for your participation, we hope you enjoyed the problems!

You can upsolve the problems here. The editorial can be found on either the contest page or the upsolve link. The combined scoreboard for both days including the official contestants will be published soon.

We thank everyone who is involved:

- fushar for the TLX platform.
- prabowo Pyqe rama_pang nightlight as Scientific Committee.
- ayaze Zanite Morphymorphymorphy Owmicron rfpermen joelgun14 ArvinCiu as testers.
- Pyqe yz_ wiwitrifai as problem authors.

We hope that we can host TOKI Open again in the future!

**UPD3.** You can find the complete combined scoreboard of both days here.

:(

The IOI 2024 contest environment is not published yet, and IOI 2023 was using C++17, so we try to make them as similar as possible.

Is it a mirror? Or the Indonesian team candidates will also participate on this website?

The official participants will have their own separate contests, but they will use the exact same problemsets.

But is it at the same time (or day)?

The official participants will start one day earlier.

Will there be editorials?

English and Indonesian editorials will be provided after contest

Bump! Day 1 contest window will open in 2 hours!

Can Copper Mine be solved using Centroid Decomposition, or I have lost in the math of the time complexity?

We didn't expect the problem to be solved using centroid decomposition, but someone managed to solve it that way.

can someone tell their own solution for problem A Buffet leftovers.

Centroid Decomposition 2 days in a row? Wow.

ngl the editorial for 2A that uses centroid decomposition reminds me of this

The intended solution to get accepted which uses $$$Q\leq20$$$ doesn't use centroid decomposition. However, towards the end of the contest preparation, one of our committees found a solution with $$$Q\leq16$$$ which uses centroid decomposition. In the end, we decided not to lower the constraint for $$$Q$$$ and kept it at $$$20$$$, so that solution isn't necessary.

Somehow I used CD to get 99 pts without any ideas provided in the editorial about P.

Yeah I had ideas using CD (centroid Decomposition) as well.

ideaswhen we get the current centroid, we say that if there are >= 3 adjacents to it then we apply something similar to subtask1 and find the subtree which contains the root. Hence in very few queries, we have reduced our space to at most half.

But if there are 2 adjacents then we find the chain which this vertex is part of and the next vertices to the endpoints of chains have degree >= 3 (otherwise they would had been in the chain). Now, we have 3 parts (The chain, and 2 subtrees with their represantatives having degree at least 3). Now, we go the maximum sized part and find if the root is in that part or in the other ones. For chain, it is similar to subtask 2 and for deg >= 3, it is just again doing the same thing as we did for the first case (or subtask 1).

I could not implement these ideas in time, do you think they were correct> I think even if I have done some naive queries I would have got at least 80 points (assuming I get 30 points in subtask 1 and subtask 2 and 50 / 70 in subtask 3).

Nearly same solution here, but it was pain implementing it — so many edge cases.

Can someone please explain the dp solution for subtask 2 of buffet?

The operations are equivalent to picking one non-decreasing sequence (corresponding to type 2 operations) and one non-increasing sequence (corresponding to type 1 operations). We save the last element in the non-increasing and non-decreasing sequence in the dp state, along with the index, for a total of $$$O(N \max(A)^2)$$$ state. The transitions can be done in $$$O(1)$$$.