# 2 October training content summary

1.xor calculation, double the original number obtained xor a constant number (2N + 1)
2.3 N + 1
defined as a new operation for the predetermined @ ternary adder without carry bit
1 = 0 1 @ 1 @
2 @ 2 @ 0 2 =
3N + 2
consider 1 @ 1 = 2; 2 @ 2 = 1;
if three appearances, = 0, the last answer is provided by two occurrences!
3. Maximum blank matrix:
the maintenance of two-dimensional prefix + and violence!
Hanging wire method? Enumeration top left corner of the lower right corner +
3 farming programs
consider the one-dimensional space how to do?
. 6. 6. 9. 3. 3 2 2. 7
T>. 6
floating cursor? Sliding window?
? ? ? ?
4. By classroom!
difference?
Dichotomy?
5.RMQ
take ans = max (a [li .... ri])
For ans, there ans = max (a [li, li + (ri-li) / 2], a [li + (ri-li) / 2, RI]);
6. the interval count modulo
when p <100 + pretreatment half
when p> = 100 p <10000
recursive position
7. flood
positive sake not miss, do upside down, first of all the neutered cities, the city retained drowned
reducing each city on the water, and the process combined Unicom
8. flooding upgrade (Star Wars)
Consider, as just as maintenance disjoint-set, for the set u, if added to the city v, the contribution sum + = size (u)
However, the range of data 1e6 is not feasible!
If n cities Unicom
(n-1) + (n -2) + (n-3) + .... + 1 = n (n-1) / 2;
or consider the process just done backwards, when combined a collection S1, S2 when
S1, s2 contribution to the answer is * S2 S1!
(in fact, most merger is a collection of four!)
9. imprisoned criminals
consider maintaining two prisons for criminals i, j, according to the probability that they will conflict sorting
10. stone scissors cloth
1. with authority table
2. disjoint-set split point
11. The bread
Manhattan distance? ? ?


precursor ri i represents the number
if ri i == i represents the roots
when we delete when a number
ri == getRoot (. 1-i);
12. The median maintenance
maintains two stacks
a large root opening pair, a small open root stack
to ensure a large number of root above the bottom of the stack than the big
13. leftist tree
14. the tree array: lowbit operation
int & lowbit the -X-n-x =;
the -X-is the complement of x
provided x = 100100

Equivalent to a higher 1000000
100100
subtraction
0011100
start same as the original from the first one
after the equivalent of Bitwise!
Therefore, 1000 = 100100 & 011100;
15. Fenwick tree maintained by the difference array Update (X, A [X] -a [-X. 1]);
16. A modified zone, inquiry interval?

 

The PM:
1. segment tree
maintains some strange thing
a n m lattice, within each row is not connected to only two adjacent rows of several?.
Point between the edged (one way only from top to bottom ).
several queries a number of routes between two points article, or add / delete an edge (still satisfying
the above conditions).
n-, Q ≤ 1E5, 1E2 ≤ m.
consider the DAG, the number of programs between two
normal : + DP topological sorting
segment tree leaf node stores a something similar adjacency matrix;
segment tree topology own sequence;
for any one sub-tree structure, shown that he adjacency matrix Mfa
Mfa [I, J] = ΣMlch [ i, k] * Mrch [k , j];
segment tree maintenance matrix, as long as he's around two intervals can be combined, then you can consider using the tree line
to merge!
Matrix multiplication!

2. Maintain the number of columns, the interval is set to support a number of intra-query intervals have a different number of segment number
1. Record the total number of how many segments, this one left end point node record number of tree line and breakpoint number
2. Merge compare two sections of the left and right end, to decide whether to add 1

3. Wonderful highly
similar to watching a different floor from a height direction? You can see how many buildings?

(1) block? + Half? ? ? Half of it should not be ordered in the table? ? ?

(2) consider the tree line, the node maximum-story maintenance node, set it as tallest,
about his son's maxh as hL, hR;

(. 3) COUNT, rightcontri, tallest
4. find enormous
initial all-0 is
equivalent to a huge lazytag
consideration the current lazytag pushdown operations:
need not have his son out, i.e., the number of parts is not necessarily required
lazy: all = 0
is about son null
modify operation will now be considered! His son is now open modifying!
There are left and right sides lazy
continue recursion modify
access only to a certain point only need out of that node, each visit is only
open logN nodes, so we can put the space segment tree complexity of
control in mLogN, this does not support dynamic open Clicked!
You need to unlock skills pointer segment tree

5. Computational Geometry?
All seek rectangular footprint?
Discretization: compressed into a smaller range, may not require a prescription to achieve dynamic
scanning lines
6. The enhanced version of the scanning lines
concerned only data within the range of k, maintaining <= k covered giant

7. search tree?
How to build a binary search tree
traversal sequence
each time the intermediate tone as a root node to establish subtrees


Scapegoat tree (without rotation modulation codes difficult, not TLE)
of a tree of size n, complexity is amortized nlogn

Obtaining the number of child nodes of each node
is defined unbalance index factor divided by its own size to a large value of about sons
defined index> 0.7 imbalances when
each insert is inserted along the chain
on the chain when the maximum the ub index> 0.7
remodeling imbalance subtree

 

1. Research hash algorithm, hash tables and KMP (ok)

2. Learn balanced tree Treap (ok)

3. Method suspended line: https://wenku.baidu.com/view/bc8311f69e314332396893f7.html

4. Application of advanced segment tree: the adjacency matrix node maintains / modulo counting section / scan line segment tree

5. Special disjoint-set: food chain / Star Wars / disjoint-set type

 

Guess you like

Origin www.cnblogs.com/little-cute-hjr/p/11618840.html