The first day of the Olympicode Open Olympiad has concluded. Thank you to everyone who participated!
The scoreboard for the first day can be found here.
The editorials for the first day can be found here.
It seems that the problems were a tad easier than expected for the very best people, but hopefully everyone enjoyed them :-). The first two problems (Jolly Tree Buddies and Almost Sorted) were proposed by me; while the third (Base Jump) was proposed by the Yoneda twins: : E869120 and square1001. Thanks to them for the task.
If you have any feedback for the Olympicode platform, please contact us, or use the "Report Issue" button on the website. If you have any feedback for the problems, or interesting solutions, please share them below!
The editorial and results of the second day will be uploaded after the second day (shocker!).
Update (Day 2): The second day of the Olympicode Open Olympiad has concluded.
The cumulative scoreboard can be found here.
The editorials for the second day can be found here.
Today's problems were proposed by me. I sincerely hope you enjoyed solving them!
The winners (getting the Olympicode hoodie) are:
- TadijaSebez: 600 points
- Nachia: 600 points
- shiomusubi496: 574 points
- Andreasyan: 510 points
- keisuke6: 498 points
Special congratulations to TadijaSebez and Nachia for completely solving all problems!









I was using the formula
depth(u) + depth(v) - depth(lca(u, v))to calculate the distance between two nodes u and v in a tree... (Yes, I completely forgot to multiply thedepth(lca(u, v))term by 2!!!)Due to this error, I failed subtasks 1, 3 and 4 of problem A, did not have time to implement subtask 2 and lost 50 points as a result. :(
Thank you for participating the contest. Hope you enjoyed the problems.
Can C be solved with dnc on queries? In upsolve I managed to solve the subtask where there are $$$\le 50$$$ jumps with some observations on how to merge two cartesian trees of non-intersecting intervals. The time complexity for 8th group completely matches, maybe there is a way to push the solution for general case?
Yes, it can be solved using divide and conquer on queries.
Yes, I did something similar to IOI18_meetings.
Let $$$m$$$ be the index of the maximum in the range $$$[l,r]$$$.
To find the answer for all queries that has the maximum element at $$$m$$$, we need to maintain these two arrays.
Then, the answer to query $$$[l^\prime, r^\prime]$$$ will be
We apply the following divide and conquer.
To update $$$S_l$$$, we can do
and update $$$S_r$$$ similarly.
We can use lazy segment tree for the aforementioned operations.
Time complexity: $$$\mathcal{O}((N + Q) \log N)$$$
Auto comment: topic has been updated by Pajaraja (previous revision, new revision, compare).
There is a problem in the editorial of day 2, it does not allow me to access it
Should be fixed now.
Yes fixed, thanks
Auto comment: topic has been updated by Pajaraja (previous revision, new revision, compare).
For Almost Sorted, there's a way to solve without lazy.
A permutation is almost sorted if and only if
(one-based)
Now, we can write a very short greedy with Fenwick.
Also, it can be proven that the answer is
where $$$s$$$ is the number of distinct elements in the prefix maximum of $$$p^{-1}$$$.
As far as I see, in problem Court Ordered we use segtrees that store bitwise ORs and ANDs. But I'm not sure how we can update these trees, is there some kind of source that explains it?
my submission
It's just an abuse of two pointers
Thanks, much appreciated)
I solved Jolly Tree Buddies with following algorithm (unproven), but it seems a correct proof exists using some ideas I couldn't think about...
Starting from vertex 0, repeatedly move to the unvisited vertex b where
d(a,b) / (v[a]+v[b])is maximized (vertex a is your current position). Repeat this movement for 4.9s. The maximum value ofd(a,b) / (v[a]+v[b])encountered during this time is the answer.I've thought about this solution and tried for a long time to generate an example to break it, but I wasn't able to.
That algorithm will definitely converge to the correct solution in
Nsteps: supposet[i]is the time personineeds to meet anybody else. Using the operation (finding the furthest one) will increase the value oft[i]up to some point. From then we will get some point wheret[i]=t[j]=tfor somei,j, and the value where thistis achieved is from one to another. Then for everykwe will be able to meet bothiandjin timet. This also means that the meeting point ofi,jis reachable in timet(this is very similar proof to the lemma that the solution is the max meeting time for trees, probably easiest using Helly's lemma for trees). This also means any two can meet in timetcompleting the proof.Also, if there are no reasonable limitations for the values for the speeds and lengths, this can take up to
Nsteps. We can take a star graph, where nodeNis the root, and personi(fron1toN-1) who has speed of10^ilives in cityiwhich is connected toNwith a road of length2^i. Then the person maximizing the distance of personiis alwaysi-1. This means that if we start fromN-1we will head through everyone until finally arriving at the furthest pair.I have no idea how to construct a counterexample for small values of speeds and lengths (or if such a counterexample exists! My intuition says it doesn't). If anyone has an idea for a proof or counterexample, I'd love to hear it.
Thanks for sharing your solution and hope you enjoyed the problem (s)!
Hey everyone, thanks for participating! We hope that you enjoyed the problems and the platform and that you will be back in the future! We received great feedback from the contestants and already made some small improvements on the platform based on it. For now, we are focused on adding new features and further improving the platform, so expect to hear from us in the near future again. Until then, have fun upsolving the problems and give any feedback you have!
Congratulations to all of the winners. I will be contacting you soon to talk about delivering the prizes. We hope that the problems were fun both for the strongest competitors and those still getting there (and it seems it was good warmup for Nachia, since he won the combined div round right after the Olympiad!). There were certainly a few things that we could improve in the future (for instance, all three of us independently missed the easier solution in B, as is clear from the editorial, which made Day1 too easy for the best competitors), hopefully it didn't affect your enjoyment too much.
Apart from being very stressful, it was also very fun for us, as we organized an onsite variant for the Serbian competitors. We invited some of the most successful competitors from the past and it was great to see everyone at the same place, even those that didn't compete for a while (and it seems they never lost a step). Congrats as well to the winners of the onsite — TadijaSebez, ivan100sic and wxhtzdy.
Hey everyone, in problems Almost Sorted and Court Ordered Problem we added some additional tests to make the testset stronger for upsolving. We will not be regrading old submissions to avoid messing with the contest results.
Also, we are publishing the contest materials under the CC-BY-SA license (same as JOI), so feel free to use them for different trainings and judges. The archives containing tests (including the new ones under 'add' folder), solution, statement, editorial and subtask mappings can be found here.