Abstract: Note: all of the instructions below are intended to help understand templates and do not guarantee correctness.Some pits: the scope of FFT: whether the array is empty, how many times the module x is (the same type must be a polynomial in the same $x^n$meaning), the polynomial inversion is known to be $A (x) $, and the $A (x) B (x) =1\ (mod\ mod\) $is obtained (considering the multiplying power of 2 for the convenience of false set).Read the whole passage

Abstract: Note: all of the instructions below are intended to help understand templates and do not guarantee correctness.The maximum flow dinic takes every S and T flow into account, but it needs to solve the problem of turning circles. First, BFS is used to divide your network into layers. Then, DFS will be optimized according to the level (each point can only go to the next level). As far as possible, the traffic can be optimized to the full arc: every point has been accessed in one DFS.Read the whole passage

Abstract: Miller_Rabin fast ($O (slogn) $, s is the number of trials) to test whether a number is prime or not. First, there is Fermat's small theorem $a^{p-1}=1\ (mod\ P) $when p is prime number, so we can choose a to choose the formula as a certain judgement basis, but not all numbers do not satisfy this formula. Even the existence of a composite number does not satisfy this formula for all a, and then has two.Read the whole passage

Abstract: consider the use of ray (a point and a vector) to represent the left half plane, so we can first press the angle between the positive and the semi axis of the X axis (atan2 (y).X) sort, then use the double ended queue to maintain the current ray in the intersection, so you need to use the dual ended queue, because the first team and the tail are likely to be popped out when the new 1.5 plane is inserted.Read the whole passage

Abstract: min-max tolerance: $$max\{a_I\}=\sum\limits_{S} (-1) ^{|s|-1}min\{a_I|a_I \in S\}$$about proving that a number of $a$can be regarded as a set of $\{1... A\}$, so Max is equivalent to union. Min is equivalent to taking intersection. It becomes a common tolerance and then the problem can be understood by DP.Read the whole passage

Abstract: the number of connected blocks can be maintained and a diagonal scan line can be maintained. Set only keeps the points in the R range, but how to maintain connected blocks?In fact, we only need to connect the most left-handed and right-hand points that can be reached, and the rest of the points will be even better.Read the whole passage

Abstract: considering the black and white coloring of non barrier points and making the maximum matching of the two partite graphs, the conclusion is that the first hand is to win if and only if it is not a perfect match, and the point that can be placed is that those points that can not match start from the non matching point, and the latter can only go to the matching point, so that the matching edge can be reached first.Because it can not walk through the point, so now it has become a non matching point; until then, there is no way to go, so the first hand will win against the perfect match.Read the whole passage

Abstract: the principle defines two properties for each point on the automaton: [min, max] and right set, this point representation (length is [min.The set of the right endpoints of max] is the substring of right. Then it can be proved that the right sets of the two nodes do not intersect or contain each other, so that right directly contains the point (right of a certain point) as its father.Read the whole passage

Abstract: the principle of the use of the balanced tree (the implementation of interval reversal) is the same as Treap. In order to represent the order of weights, and each point has a random added value, it forms a heap to guarantee the complexity but not rotation. All operations are divided into two kinds of split by split and merge: by weight and ranking code luogu3369 common balance tree.Read the whole passage

Abstract: when considering less color, the first question can directly consider second points of Steiner tree, consider two points, and each time the weight of each grid is 1000+[a[i]>m], that is to say that the number of the smallest number is m or less.However, too many colors can not be done directly, but you can map each color to less than 5. In this case, the correct rate of doing the same thing is the probability of the 5 colors being mapped to 1~5 as $\frac{.Read the whole passage