Note: The score indicates the actual difficulty and the quality index .
Problem A. Aliases
Rating: .
You find that the is satisfied by the roughly level. All we need to do is enumerate and throw the English part of each into the map.
Time complexity: .
Problem B. Bars
Rating: .
It’s easy to write the dp formula: , and you think of that latter lump as the trapezoidal area, and then what you’re actually solving for is the convex packet area. A little maintenance of the convex packet is all that’s needed.
Time complexity: .
Problem C. Ctrl+C Ctrl+V
Scoring: .
Every time you match just change the right after it to a special character.
Time complexity: .
Problem D. Dazzling Mountain
Scoring: .
You take the de-enumeration and number the leaves in dfs order, with consecutive leaf numbers that a node can cover. Get a line tree or something and you’re done.
Time complexity: .
Problem E. Euclidean Algorithm
Scoring: .
The following fractions are all rounded down.
Notice that satisfies if and only if , and try to enumerate , that is, counting at (which satisfies that this thing must have ), which is actually , and this thing can be divided integrally into chunks to find out.
You find that can divide chunks integrally, just by integrating chunk sets.
Time complexity: .
Problem F. Flower Garden
Rating: .
This thing is a lot like 2-sat, in that with violets in it can launch all violets. First the line tree optimizes a building graph, the classic set of shrinking points.
The problem is equivalent to, each scc will have a weight, the sum of the weights is , choose a derived subgraph weights between . The approach is:
- If you don’t pick a point with weight , then greedily pick surely one of the moments will be in . A direct topological order is sufficient.
- If we pick, we just need to minimize the weights and get the derived subgraph containing this point directly, there will be no more than points of this kind.
Time complexity: .
Problem G. Great Chase
Score: .
We only need to consider how long Mad Dog will live and multiply by the time to find the distance.
The mad dog lives for exactly as long as it takes for the person behind the mad dog to first meet the person in front of him. Just bisect it directly.
Time complexity: .
Problem H. Hyperloop
Score: .
Maintaining line trees with high precision is sufficient, much like the classic problem.
Time complexity: .
Problem I. Investors
Score: .
Interval inverse pairs satisfy quadratic inequality. Direct partition optimization.
Time complexity: .
Problem J. Job for a Hobbit.
Score: .
First it is easy to find out that it is legal if and only if:, where it is rounded upwards and is the number of occurrences of the color.
We find that constructing each color in turn will take up empty space, so we consider constructing the “full” case first, and then push to the target sequence.
Specifically, we arrange the colors from left to right, top to bottom, and we get the target sequence , we just need to figure out how to reach the target sequence , the rest we can shift one color at a time to meet the construction.
At this point, the problem is converted to one where each point in the original table has a goal position, and the goal positions are only in the first columns. This way we can construct one column at a time. We only need to construct the first column to construct all the subsequent columns at once.
Each time we have two empty columns, we move the empty columns to the top positions. The task of is to preserve the construction and the task of is to assist in the construction. We consider moving each point to the column one at a time from the bottom up.
Consider the current target point position at and we consider moving to the top . First of all if it’s already done. Specifically, move all of the part above (including ) to the column, then move the target to , and then move the ones on the column back to .
This reveals that we only need to make fewer each time, without changing the general shape of the elements on the columns.
We consider moving the empty column to , then moving all the elements at the target point to , then moving all the elements on the column to , and then moving them to if they can still be moved to . It is easy to see that this way since has no more than elements in total, it is always possible to make empty, and then the empty column goes to , with elements of , completing the generalization.
A small problem is that if is at the bottom of the column and the column is full. At this point the target column must not be full, we can move the top element of all the columns collectively forward one place, the above the empty space, then we move the top element of to can be the same as the above a practice. Note that the top elements should be panned back collectively after this is done.
Operation step: .
Problem K. Kooky Tic-Tac-Toe
Score: .
Enumerate the last move, deleting this move the game cannot end. Then just assign it randomly.
Time complexity: .
Problem L. Line Replacements
Rating: .
A sufficient condition for legality is that for points that can’t be used as starting points, there are , and the latter thing is even. Just delete from largest to smallest according to edge weights.
Time complexity: .
Problem M. Minor Evil
Scoring: .
Considered from back to front, if a person is going to be used again in front of them keep them, otherwise just kill them off.
Time complexity: .