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
Posted @ 2019-07-10 09:50 Ressed reading (33) comment (0) edit
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
Posted @ 2019-07-05 10:08 Ressed read (44) comment (0) edit
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 a can be chosen randomly as a basis for judging this formula, but not all the composite 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
Posted @ 2019-06-24 13:33 Ressed read (28) comment (0) edit
Abstract: consider the use of ray (a point and a vector) to indicate the half plane on its left side. Then we can first sort the angle between the positive and the half axes of the X axis (atan2 (y, x)) and then use the double ended queue to maintain the current rays in the intersection. The reason why we need to use the double ended queue is that the first team and the tail are likely to be popped out when the new 1.5 plane is inserted. Read the whole passage
Posted @ 2019-06-20 14:15 Ressed read (15) comment (0) edit
Abstract: min-max tolerance and exclusion: $$max\{a_i\}=\sum\limits_{S} (-1) ^{|s|-1}min\{a_i|a_i \in S\}$$about proving that a number $a$can be regarded as a set $\{1... A\}$, so Max is equivalent to union, and min is equivalent to taking intersection, so it becomes a common tolerance and then the problem can be understood. Read the whole passage
Posted @ 2019-06-07 16:23 Ressed read (21) comment (0) edit
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
Posted @ 2019-05-02 17:29 Ressed read (28) comment (0) edit
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
Posted @ 2019-04-27 15:53 Ressed read (14) comment (0) edit
Abstract: the principle defines two properties for every point on the automaton: [min, max] and right set. This point represents the subset of the right endpoints in [min, max], and all occurrences of the positions, and then it can be proved that the right sets of the two nodes are either intersecting or mutually containing, so that right directly contains the point of right of a point as its father. Read the whole passage
Posted @ 2019-04-26 13:48 Ressed read (21) comment (0) edit
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
Posted @ 2019-04-13 09:33 Ressed reading (39) comment (0) edit
Abstract: when considering less color, the first question can be directly asked by the second question of Steiner tree, considering two points. Each time the weight of each grid is 1000+[a[i]>m], that is to say that the number of colors chosen is less than m, but the color can not be done directly, but it can map each color to 5. So, the accuracy of doing the 5 colors is the probability of mapping to 1~5, which is $\frac{. Read the whole passage
Posted @ 2019-03-28 11:00 Ressed read (39) comment (0) edit