We would like to invite you to an online replay contest for UWCOI 2020. UWCOI is an OI-style contest hosted by UWCSEA Dover which was attended by multiple schools in Singapore. It was also used to select the UWCSEA Dover team for the Singapore National Olympiad in Informatics.
Here are some additional details:
The contest will be held at 21:00 IST, Tuesday 25 February (tomorrow).
7 OI-style tasks (all tasks have subtasks) in 3 hours.
The questions are of a high quality and the contest will be rated for both Division 1 and Division 2.
There are also prizes, which are detailed under the contest page.
You can expect proper OI-type questions, overall. The contest was prepared to select a team for an OI contest so we felt it was very important to write questions that are also in OI style.
What is the intended soln of “Escape” the last subtask?
Judging by memory taken 3 solns got AC using O((n*2^k+e)*log(n*2^k)) (which was intended be the soln of second subtask) including first 2 ACs on this problem.
Since I got AC using it I didn’t tried it again.
1s time limit was too tight on “Optimal Memory Address”. I had to use fast IO to reduce constant factor and get AC on it.
First subtask was to check all factors of n.
Second subtask was to utilise the fact that if X is the minimum size of repeating block, then any factor of X is also a repeating block. So you can check n/(prime powers divisible by n) to find it.
Third subtask was to binary search on this prime power.
Use the fact that each row and column has only one tower square. Just check all pair of rows and distance between minimum and maximum column to check if there exists a plan between that row and column.
My idea was to process queries offline and use union find. I just copied my soln of E. New Year Castle with 2-3 lines changes. You can read its editorial.
Anyone mind telling me what was wrong in my submission (the actual code starts from line 200) for Optimal Memory Address.
The idea was to building a weighted trie on the prime factorization of the numbers and finding the node that minimizes the sum of distances to all the marked special nodes.
Edit: I found a few errors, the main one was when traversing the node to minimize distance I was incrementing by the number of all elements in parent’s subtree rather than the total number of elements, it still TLEs in one testcase but I should be able to figure that out.
I believe that your solution (as well as the solution of mrho) are actually unintended and run in quadratic on an edge case, which you barely passed through constant factor tricks. Note that the Java submission of uwi runs in 0.24 seconds.