A. TreeScript
- Difficulty factor: .
- Code power factor: .
Simple tree dp. Suppose denotes the case where only -subtrees are considered, are all the sons of , , then .
Time complexity: .
Problem B. Big Picture.
- Difficulty factor: .
- Coefficient of force: .
This is a misread problem. The original idea was that the th row (column) must be coloured with a prefix, and the probability of colouring the first is .
Clearly the black part will form a connected block, and the white part exists except for the outermost one which exists exactly where meets both black. It is sufficient for each person to discuss the contribution.
Time complexity: .
Problem C. Painting Grid
- Difficulty factor: .
- Code power factor: .
Firstly is even and . Let’s assume that is even.
We can make the first rows satisfy the rows and columns are different and equal by construction:
- Write binary to the first column and the inverse of binary to the column.
After constructing the first row, you can construct two rows of two rows after that, just find a random that hasn’t appeared before and put it in the new row, and put all the inverses of in the next row.
Finally, if there is a line left, just find a equal to the number of that has not appeared and fill it in.
Time complexity: .
Problem D. Shortest Path Query
- Difficulty factor: .
- Code power factor: .
Lemma: of lattice diagrams with convex packets of size not exceeding .
In this problem, the lower convex packet of each point can be built out, and the query can directly run the whole convex packet.
Time complexity: , not enough to run.
Problem E. Goose, goose, DUCK?
- Difficulty factor: .
- Code power factor: .
The problem asks us to count: the number of intervals in which each number occurs no more than times.
For each colour, a section of the interval is ban dropped, and only one colour’s interval changes as is added.
So it becomes a problem of adding intervals and asking for the number of intervals . The line tree maintains the minimum value of the interval, the minimum number of intervals can be.
Time complexity: .
Problem F. Sum of Numbers
- Difficulty factor: .
- Code power factor: .
Note that in the optimal case the difference in length between neighbouring ends is no more than . Direct dfs is sufficient.
Time complexity: .
Problem G. Paddle Star
- Difficulty factor: .
- Code power factor: .
Big points for discussing the problem. Equivalent to taking a hammer-like object and turning it at an angle to ask for area covered. The stick contribution can be counted directly. Just discuss the hammer part.
There are more situations.
Time complexity: .
Problem H. Another Goose Goose Duck Problem
- Difficulty factor: .
- Code force factor: .
Check. The answer is . Round down.
Problem I. Range Closest Pair of Points Query
- Difficulty Factor: .
- Code Force Factor: .
The ynoi problem that people love to see.
Consider first what to do with a single query. Consider that the answer is , and we divide this plane in squares of (). Then there will not be too many points within a block that are . We only need to look at the contributions generated by points within and between neighbouring blocks.
Enumerating in turn is sufficient.
You see that this is very scalable, in that all we need to do to find dominant pairs is to look for a difference of no more than in the number of each block that produces a contribution.
This looks like the dominant pairs are , with being a large constant. The query is just a matter of dropping these dominant pairs into some data structure and checking the minimum of the interval.
Considering the large number of dominant pairs, we just need to make a chunk.
Time complexity: .
Problem J. Dice Game
- Difficulty factor: .
- Code power factor: .
The question asks you to find . Suppose . Then you find that the positivity of is roughly , with contributing independently to each binary bit, and it’s just a matter of taking an individual dp and calculating the intervals and interval maxima.
Time complexity: .
Problem K. Maximum GCD
- Difficulty factor: .
- Code force factor: .
Just note that can be manipulated to become a number between or .
Time complexity: .
Problem L. Permutation Compression
- Difficulty factor: .
- Code Power Factor: .
Can magically delete the maximum value of a continuous segment of length one at a time. Definitely delete from big to small, each time to find out the largest scalable segment (on this segment must be elements, get a st table above the bisection) and then use the worst but can be satisfied with the magic can be, with set maintenance.
Time complexity: .