ICPC Asia HongKong Regional Contest 2022 Solutions
Otomachi_Una_ · · 个人记录
A. TreeScript
- Difficulty factor:
4 . - Code power factor:
2 .
Simple tree dp. Suppose
Time complexity:
Problem B. Big Picture.
- Difficulty factor:
5 . - Coefficient of force:
3 .
This is a misread problem. The original idea was that the
Clearly the black part will form a connected block, and the white part exists except for the outermost one which exists exactly where
Time complexity:
Problem C. Painting Grid
- Difficulty factor:
7 . - Code power factor:
6 .
Firstly
We can make the first
- Write binary to the first
\dfrac m2 column and the inverse ofi binary to the\dfrac m2+i column.
After constructing the first
Finally, if there is a line left, just find a
Time complexity:
Problem D. Shortest Path Query
- Difficulty factor:
6 . - Code power factor:
6 .
Lemma:
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:
Problem E. Goose, goose, DUCK?
- Difficulty factor:
4 . - Code power factor:
6 .
The problem asks us to count: the number of intervals in which each number occurs no more than
For each colour, a section of the interval is ban dropped, and only one colour's interval changes as
So it becomes a problem of adding intervals and asking for the number of intervals
Time complexity:
Problem F. Sum of Numbers
- Difficulty factor:
3 . - Code power factor:
5 .
Note that in the optimal case the difference in length between neighbouring ends is no more than
Time complexity:
Problem G. Paddle Star
- Difficulty factor:
6 . - Code power factor:
6 .
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:
0.5 . - Code force factor:
0.5 .
Check. The answer is
Problem I. Range Closest Pair of Points Query
- Difficulty Factor:
9 . - Code Force Factor:
7 .
The ynoi problem that people love to see.
Consider first what to do with a single query. Consider that the answer is
Enumerating
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
This looks like the dominant pairs are
Considering the large number of dominant pairs, we just need to make a
Time complexity:
Problem J. Dice Game
- Difficulty factor:
8 . - Code power factor:
7 .
The question asks you to find
Time complexity:
Problem K. Maximum GCD
- Difficulty factor:
4 . - Code force factor:
3 .
Just note that
Time complexity:
Problem L. Permutation Compression
- Difficulty factor:
6 . - Code Power Factor:
6 .
Can magically delete the maximum value of a continuous segment of length
Time complexity: