Hello, Codeforces!
We would like to invite you to participate in the live online mirror contest of The 2026 ICPC Asia Pacific Championship next weekend. ICPC Asia Pacific Championship is the contest for top non-winning teams from all regional contests in the region to qualify to the World Finals. See the region rules and competition page for more details.
The official contest is scheduled to start at Sunday, 8 March 2026, 09:30 AM (UTC+8). The live online mirror contest is scheduled to start only 15 minutes later, to keep both contests run almost in sync. The contest is 5 hours long and consists of several problems.
Please note that we might have to postpone the live online mirror contest in case the official contest is delayed. This is to ensure that the tasks are not available to the public until the official contest starts.
The contest will use ICPC-style scoring (same as the official contest) and will be unrated. You can participate as an individual or as a team, although as a team of three members is preferred.
See you on the top of the leaderboard!
The 2026 ICPC Asia Pacific Championship Judges
[UPD]: Task analysis









rp++ rk--
Is the online mirror's scoreboard synced with the actual contest scoreboard?
If you mean whether the actual contest scoreboard will be visible in online mirror's scoreboard (as ghost participants): no, we can maybe add that after the contest.
If you mean whether the problems are in the same order in both contests: yes.
There is a solution for E in $$$O((n + q)\log n)$$$, using m stacks.
https://mirror.codeforces.com/contest/2206/submission/365799729
Could you explain how it works? I can't understand that.
I will use 0-based indexing for convenience with mods.
Note that $$$s_{i+1} - s_i = (a_{i+1} + \ldots + a_{i+m}) - (a_i + \ldots + a_{i+m-1}) = a_{i+m} - a_i$$$, so for all $$$i$$$, the value of $$$a_i$$$ is determined by $$$a_{i \bmod m}$$$ and the input array. More formally, $$$a_i = a_{i\bmod m} + c_i$$$ for some constant $$$c_i$$$, and we can pick $$$a_0 \sim a_{m-1}$$$ freely as long as $$$a_0 + a_1 + \ldots + a_{m-1} = s_0$$$.
If $$$r - l + 1 \lt m$$$, then the answer is unbounded. Otherwise, we know that each query is asking for the smallest possible value of $$$\max(a_0 + x_0, a_1 + x_1, \ldots, a_{m-1} + x_{m-1})$$$ where $$$x_i = \underset{l\leq j\leq r \wedge j \equiv i\bmod m}{\max} c_j$$$.
To get the minimum value of the above expression, consider when we can make it $$$\leq t$$$ (think binary searching on answer). We get $$$a_i + x_i \leq t$$$ for $$$0 \leq i \lt m$$$, and summing up all the equations, $$$s_0 + \sum {x_i} \leq mt$$$. Rearranging gives $$$t \geq \left\lceil \frac{s_0 + \sum {x_i}}{m} \right\rceil$$$ which is the answer.
Now, finally, stuff that isn't in the official editorial: we process the queries in order of increasing $$$r$$$. This is nice because if we are currently answering queries with $$$r = j$$$ when $$$c_0$$$ to $$$c_j$$$ have been processed, and we see that $$$c_i \leq c_j$$$ where $$$i \lt j$$$ and $$$i \equiv j \pmod m$$$, then $$$c_i$$$'s contribution to $$$x_{j \bmod m}$$$ will be overshadowed by $$$c_j$$$.
Therefore, we can maintain a monotonic stack for each set of indices that give the same value $$$\bmod m$$$, where the topmost elements have larger index and smaller values. If $$$c_i$$$ and $$$c_j$$$ $$$(i \lt j)$$$ are next to each other in our monotonic stack, then that means if the query left bound $$$l \leq i$$$, it will contribute $$$c_i - c_j$$$ to our answer.
We can use a point-update, range-sum segment tree to maintain this difference array on our monotonic stack. To get $$$\sum {x_i}$$$, we just query the range sum from $$$l$$$ to $$$r$$$ at the moment we have processed $$$c_0$$$ to $$$c_r$$$. It runs in $$$O((n + q) \log n)$$$.
Wow that's amazing! Got it.
problem — K
consider this testcase
if you got WA in TC-22
I hope everyone can pass smoothly, good luck.
Was sqrt decomposition unintended for D? I had to use some stupid tricks to make it fit within the TL
someone explain solution of problem K...
For Problem K:
I think you can avoid binary search entirely and get an O(N) solution.
I solved it by greedily trying to generate valid solutions and just counting how many there were, breaking when no more solutions can be found. It takes O(1) to generate the next solution, and there's a maximum of N/4 solutions.
Is this a faster/simpler way of solving K, or is there a benefit of using binary search like the intended method?
373286371 2206K - Time Display Stickers