csp-s Analog 47

T1:
Consider each black stripe is actually a range limits, then the calculated limit feet long inside removed
and each k can take, it is possible to cover the line segment k in the sense die
if no full coverage Solutions otherwise solvable.
(Note that if a certain limit interval is greater than the first black bar k, be sure no solution)
(Note also that if a black bar across the mold sequence of k, then split into two required)

T2:
Violence segment tree merger would be finished

T3:
KMP processing a set of original strings t
consider the question is in fact: a configuration lexicographically smallest string 01 string it with the original array nxt same certain locations
to consider how to meet when the i-th limit satisfies the first i + 1 limitation
is provided \ (delta = len_ {i +
1} -len_i \) if \ (delta <len_i \) , compared to satisfy the constraints nxt directly copied delta suffix length connected to the rear
when the \ (delta> = len_i \) , then the string on the final copy, 0 up to the middle.
However, this time may not satisfy the condition, so when a new string kmp go \ (len_ {i + 1} \) needed to determine what, if not satisfy the constraints, then the middle of the last bit i 0 up to the 1 can be.

Guess you like

Origin www.cnblogs.com/Gkeng/p/11790258.html