[UOJ46 metaphysics]

This question is before the month should be, but there has been no understand, today replay again, the hang of it.

Description meaning of the questions:

The operation is located a $ [l..r] $ $ X $ all elements into $ (ax + b) \% m $.

By force, each time you define a new operation, or ask only transform the role of the elements $ l..r $ $ k $ positions are located should become much.

answer:

This question is immortal, application of new ideas.

He said the solution to a problem is a binary grouping, but in fact, which only opened the tree line, this place is not understood.

Let us analyze this operation, consider that the nature of it.

There is no first analysis of exchange law, found that apparently is not.

But we were happy to discover this operation there is associative, so maybe you can use segment tree maintenance and operation of a node can be viewed as the superposition to form around his son.

Further, we can inverse operation, that is, if we know the operation $ [1..l-1] $, the result of $ [1..r] $ post, can not launch $ [l..r] $ operation.

I found that this is not acceptable, assuming $ ax + b $ after the operation of $ cx + d $ after became $ ex + f $, when $ p $ is not a prime number, equation $ ac ≡ e (mod \ p) $ None a unique solution.

We consider two forms of segment tree partition.

One is the tree line position open for a modification operations, we determined that $ log $ intervals, internal node as it has been considered position, sorted by time, build tree line, when queried a chain go check on it.

But I found that doing so is $ fake $, because this operation is not commutative (for the paper can be said to modify the contribution of non-independent) so certainly can not do that.

One is the tree line on the opening sequence of operations, which is the practice of the solution to a problem, but unfortunately, I still did not want to come out is how to do.

My approach is difficult to talk about where

Operation has just been said associative, so the query time, we can determine the tree line segment $ log $ intervals, and then in turn be merged.

But for our internal node, if in addition to the problem of downsizing, there is no other breakthroughs, still need time in order to cover all the range of $ loc $ merger position in turn, in my opinion this is a tricky two-dimensional problem ( $ APIO2019T3 $), can not get good solutions.

Locked.

Reference general heuristic methods combined, each node of the tree maintenance segment after completion of these operations, the sequence looks like, i.e. Vector $ a $, an element represents a period interval.

But doing so $ pushup $ complexity and the number of sections on the left and right about his son, so certainly not like an ordinary tree line as it is to modify a little chain from bottom to top $ pushup $.

Because of this modification is from left to right, so when not to $ x $, the tree line to cover all $ x $ intervals are maintenance-free, from the viewpoint of the position, we need only to the left of the ancestors $ pushup $ on it.

$ Gloid $ Yeshuo did so two $ log $, let me analyze.

2N $ $ segment tree has nodes, each position is equal shares to $ O (1) $, and $ a $ a pushup complexity is about the number of sections and the son, a point up to about $ $ a pushup, Therefore, a modification is the total of $ $ log, query requires two points, two $ $ log (the minimum but constant).

Magic, ah, is considered to be modified bottleneck is not even the Bag.

This method can be extended to solve the general problem of binary packets (requires access to historical status changes, and even modify the application of some sections), the requirement is modified with a binding law.

But most of the changes do not have a binding law, as we can not quickly merge two convex hull, can not quickly merge two $ AC $ automaton, may use this approach is relatively narrow, the question is put a majority of binary groups the group torn down and rebuilt.

Guess you like

Origin www.cnblogs.com/shxnb666/p/11628644.html