The Asia-Pacific Informatics Olympiad (APIO) 2025 is just around the corner — scheduled for May 17th and 18th, and will be hosted by Uzbekistan.
For those who haven’t heard of it, APIO is a prestigious IOI-style online contest featuring 3 challenging tasks over 5 hours. It's an important part of the IOI team selection process for many countries across the Asia-Pacific region. More info is available at https://apio2025.uz/.
Feel free to use the comments to discuss problem ideas, scores, cutoffs, and results after the contest (and any mirror, if there is one) wraps up.
Good luck to everyone participating — hope it’s a fun and insightful contest!









Kindful notice: Please wait until the entire flexible window ends before you discuss the problems, as the contest runs on a flexible window spanning over two days. This is stated in the rules also.
Also you wrote 2024 in place of 2025 in the blog, looks like a typo lol
Bro started farming contribution even before the contest starts;)
will there be mirror?
Our country just received an email saying that online resources are banned. Has anyone received similar things? Quite a drastic change to the contest format if it's true..
Yes.
Our country also received a similar email.
hey, any update on this?
So apparently you can only view codes written by yourself. Not sure how they're going to police it though
At the very least, this change should have been made a month ago. When the information was sent to the players in our country, it was four hours before the start.
Yeah, I guess all countries did.
I guess the contest must be ended now, congrats to all the participants ^_^
Can anyone share p1 (hack) subtask 3 idea?, you can share any partial results solution, I could solve the first two subtasks only
To check if the size is less than $$$x$$$ or not, do
$$$1, 2, \ldots, \sqrt{x}, 2\sqrt{x}, 3\sqrt{x}, \ldots, x$$$
Do binary search. When your range is $$$[l, r]$$$ you don't actually need to check from $$$1, 2, \ldots, x$$$ but rather do
$$$1, 2, \ldots, \sqrt{x}, l, l+\sqrt{x}, \ldots, r$$$
where $$$x = r-l+1$$$
This way, you use about $$$\sqrt{10^9} + \sqrt{10^9/2} + \sqrt{10^9/4} + \ldots$$$ in total. (idk might be wrong, but this is about 150k queries => $$$78.1$$$ pt)
I thought about keeping n constant: If you do not change it, and only alternate with the second range, it will be log(n)*(n^(1/2)) + sqrt(1e9) + sqrt(1e9)/2... since 1, 2... sqrt(n) doesn't decrease. However, to make this work, you can do one iteration on 1, 2, sqrt(n), then one iteration on sqrt(n), 2*sqrt(n).. n This will be as such: 1st: sqrt(n) + sqrt(n)/2 2nd: sqrt(n)/2 + sqrt(n)/2 3rd: sqrt(n)/2 + sqrt(n)/4 4th: sqrt(n)/4 + sqrt(n)/4 ... Which sums up to be around 158000 for 1e9. And that nets you 50pts on the 3rd subtask. You can optimize the 1st iteration, since it will always trigger for l=1e9/2 r = 1e9 (for bs on the left sequence), you can make the first one take sqrt(n) queries only, instead of 3/2sqrt(n) queries. Netting around 55pts. Maybe this kind of logic could be merged to give a better score ?
Ok, I found the AC sol:
We can assume that the mod > 1e9/2
Now, we have number of queries is 2sqrt(1e9/4) + 2sqrt(1e9/8) + 2sqrt(1e9/16) + 2sqrt(1e9/32)... = 108000 queries (we already reduced it to [1e9/2, 1e9] so it takes 2sqrt(1e9/2/(2**i)) for the ith iteration (0 indexed)) We know that if x is the modulo, then a*x will also cause collisions as if it was the modulo. (a being a positive integer)
And so, what we can try to do, is to try to remove a prime factor one by one from our answer.
Let's say we got answer x
We will query [x/p+1, 1] to check if the actual answer was smaller than x.
if it returns 1 collision, then x:=x/p
We repeat this until we don't get any collisions with all primes.
This should stay under 1.1e5.
rankings and cutoffs when?
The server says that the contest is over.
How much did the top 6 of your countries get?
Egypt:
contee — 25 + 70 + 54 = 149
MinaRagy06 — 51.1 + 22 + 74 = 147.1
Octagons — 8 + 12 + 63 = 83
O_Elmasry — 25 + 36 + 5 = 66
3omar_ahmed — 25 + 12 + 24 = 61
HossamHero7 — 25 + 12 + 16 = 53
ASGA_RedSea — 25 + 12 + 16 = 53
phir. — 25 + 12 + 16 = 53
Türkiye (some people unknown, I will update when new ones are shared)
Seferoglu 82.5+12+16 = 110.5
carcinisation 72.2+22+16 = 110.2
mychecksdead 43+12+54 = 109
kerembozkaya 8+0+100 = 108
ItsNotMeItsYou 25+12+63 = 100
int_slowbutbitbetter23_t 78.1+0+0 = 78.1
PieArmy 8+46+5 = 59
Can you explain how you got 82.5 for the first problem?
I first thought about cheaply verifying if x <= n for some x. If we can do that we can binary search on n.
I noticed that the collision thingy only outputs positive integers if there are two numbers in its input whose difference is divisible by n. So if I were to somehow input a short list of numbers such that all differences in 1...n were present, we can check if x <= n definitively just by checking if anything collided. A simple construction for n = 81 is as follows:
1 2 3 4 5 6 7 8 9 10 20 30 40 50 60 70 80 81 82
I think this example will show the idea pretty well but the idea is you can use first O(B) numbers to create first B-1 diferences and O(N/B) numbers to get the rest. selecting B~O(sqrt N) yields around 43 pts. Then you basically optimise empirically, I got 78 pts for a long time but managed to optimise to 83 pts with a few math observations
Thanks
India (sorry, I don't know/remember exact scores and distributions for many, if you find your score is wrong please contact me and I'll fix it):
PoPularPlusPlus: 170.8
AdhityaMangudy: 145.?? (I don't know exact)
trash-can: 91.7
beaten_by_ai: 91
evenvalue: 87
Aviansh: 87
Taiwan (I don't know the exact distribution because we only put our total scores into a spreadsheet):
Here are the unoffical results:
https://mirror.codeforces.com/blog/entry/142990
Salam! can I know who answered to questions on mail?
Heard that the problemset has 2 interactives and 1 constructive. What the hell lmao
ojuz will the problems be available for upsolving?
Edit: they're on QOJ: https://qoj.ac/contest/2031
https://oj.uz/problems/source/apio2025
Hi, I authored problem 2 (permutation game) this year.
You can find the my pdf sunmission here and my rantings here
LOL that response from EGOI, it better not turn out that they rejected random problems on random graph classes because "it takes place on a graph, and it quickly becomes clear that the structure of the graph is very important". That really sounds like double standards to me.
Also I and conqueror_of_tourist authored problem 1 (hack) while making ideas for OCPC Potluck Contest 2 last year!
You can check the PDF submission here.
"it quickly becomes clear that the structure of the graph is not very important" how is that even remotely trivial? Yeah it's easy to guess, but if the server were slow and I didn't get full feedback to check my guess I would poop my pants out.
Can I discuss now? I have some questions about the 3rd problem.
Here's my blog about the 3rd problem: https://mirror.codeforces.com/blog/entry/143015
shoutout to Muaath_5 for getting the ideas to the three tasks but not being to implement them
Upsolve is available on Eolymp.
Upsolve is available on 洛谷.
bruh