C - Computer Science
solved by rdc 16min
The meaning of problems the number line some point, find a very short length x, such that the presence of \ (n-\) intervals, the \ (I \) intervals comprising \ (a_i \) , the number of points comprises at least \ (K \) a.
practice
- Each interval independent of each other.
- Sort of the point.
- With \ (x_ {i + k- 1} - x_i + 1 \) Interval Update \ ([x_i, x_ {i + k-1}] \)
D. Drama
solved by rdc 183min -1
Meaning of the title topic that for a long time told us that this is first and decreased after a histogram, up rose up to a grid, or disintegration.
practice
- To see through height \ (O (\ sqrt {n }) \) level.
- The columns do DP, prefixes and suffixes considered separately.
- \ (f [i] [j ] \) is represented by \ (I \) lattice last column height \ (J \) is less than or equal to 1 and the number of programs height difference between two adjacent cells.
- \ (g [i] [j ] \) is represented by \ (I \) lattice last column height \ (J \) number scheme. \ (g \) need to use prefixes and optimization.
- Complexity \ (O (n \ sqrt { n}) \)
F.Small Numbers
solved by F0_0H 28min
The meaning of problems to two numbers a, b, supports two modes of operation, (1) while removing a common factor (2) an addition, a multiplication. After operation requires a, b, and minimum
Solution to a problem of a, b for prime decomposition, for each prime factor of the number is odd, violent enumerate a or b to give
G.New Keyboard
solved by F0_0H 158min -2
That Italy print string in accordance with the meaning of problems
answer
- dp [i] [j] [0 | 1] indicates that the current process to the i-th character, and in the j-th machine, and the last operation is a printing machine or change the optimal solution
- Direct transfer will GG, but we can run the shortest path, up to two sides of each state to determine whether to print or jump.
- dij add a log, the complexity of a little fried, but also Gou past
J.Joining Arrays
solved by F0_0H 261min -3
The meaning of problems to two sequences, namely a sequence selected, and makes up a sequence of length K, requiring lexicographically smallest
explanations violence plus greedy
- Election violence enumerator to the first sequences of t, then a second sequence selected kt
- Violence selected length lexicographically smallest t and the subsequence in a sequence, b empathy
- Consider merging the two sub-sequences, merge
- 1) The first team elements are not equal, direct elections
- It is equal to 2) the first element of the team, this relatively cool, but can determine the next position by the unequal binary sequence hash adding way, to re-election greedy
- Updated answer in sequence after the merger