October do title record.

I do not want the subject. . Take a few minutes to sort out problems do record? . . Hu mouth about the way to do problems method. .

  • CF52C Circular RMQ

Segment tree lay a check mark RMQ. .

  • P1840 Color the Axis_NOI Guide 2011 increase (05)

The black point is assigned a 0 l ~ r modified
segment tree at each time interval and to modify the query finishes

  • CF1234 A ~ F game difference 5minAC title of F ... (because it is div3 not say ..)

  • P1640 [SCOI2010] continuous attack game

Given both attribute \ (A \) , \ (b \) ask you to construct the longest continuous sequence of a
greedy look to meet strict \ (a \ leq b \) by (a \) \ sorted out then fucks.
Complexity \ (n \ log n \)

  • P2071 seating arrangements

Everyone has wanted to take the number of rows, each seat two people. .
The split each row into two points. .
The source network flow with everyone and even the side of the people and then connect the two sides last point of each demolition discharged from two sides and sink even
run a \ (dinic \) came out. .

  • P3979 distant lands

In other cross-sectional root of the tree
on the operation of a second operation chain transducer 3 operating subtree root modification request RMQ. .
Consider for root classification discussed 因为链是树中唯一的independent location of the root is the same strand of the operator no classification discussed two
third operation position is considered the root (the soul of the root of the tree changing cross-sectional areas? ..)

inline int getfa(int x , int k) {
    for(register int i = 20 ; i >= 0 ; i --)
        if(k >= (1 << i)) k ^= (1 << i) , x = fa[x][i] ;
    return x ;
}
int root = 1 ;
inline void getans(int x) {
    if(x == root) {
        printf("%lld\n" , mn[1]) ;
        return ;
    }
    int y = 0 ;
    int p , q ;
    if(d[x] < d[root] && fa[y = getfa(root , d[root] - d[x] - 1)][0] == x) {
        p = Query(1 , id[y] - 1 , 1 , n , 1) ;
        if(id[y] + size[y] <= n) q = Query(id[y] + size[y] , n , 1 , n , 1) ;
        else q = INT_MAX ;
        printf("%lld\n" , min(p , q)) ;
    }
    else printf("%lld\n" , Query(id[x] , id[x] + size[x] - 1 , 1 , n , 1)) ;
}

The default root is a start and a DFS1 then changed his roots and make a comparison to be just fine. .
Complexity \ (n \ log ^ 2 n \)

  • P1963 [NOI2009] sequence of transformations

Question is intended to seek a lexicographically smallest sequence number and can be extended to a number of two and to consider directly bipartite graph matching. .
After two numbers by value of construction put small side (forward star is head over heels ..) and then ran out of the dictionary is surely the smallest order. .

  • P1758 [NOI2009] pipe take beads

Seeking \ (\ sum_ {I} = ^ {TOT. 1} {2} cnt_i ^ \) \ (TOT \) is the total number of strings can be constructed. . \ (cnt \) is the number of occurrences of the string
come transition equation

int len = i + j - k ;
if(a[i + 1] == a[k + 1]) f[(i & 1) ^ 1][j][k + 1] = (f[(i & 1) ^ 1][j][k + 1] + f[i & 1][j][k]) % Mod ;
if(a[i + 1] == b[len + 1]) f[(i & 1) ^ 1][j][k] = (f[(i & 1) ^ 1][j][k] + f[i & 1][j][k]) % Mod ;
if(b[j + 1] == a[k + 1]) f[i & 1][j + 1][k + 1] = (f[i & 1][j + 1][k + 1] + f[i & 1][j][k]) % Mod ;
if(b[j + 1] == b[len + 1]) f[i & 1][j + 1][k] = (f[i & 1][j + 1][k] + f[i & 1][j][k]) % Mod ;

Scroll bit memory array optimization \ (n ^ 2 \) time \ (n ^ 3 \)

  • P4130 [NOI2007] necklace Factory

Operating more heard \ (ODT \) seem to run fast? . . Anyway, the problem relatively early. . This problem with the maintenance segment tree yourself by hand projections about the position
and then keep it around with the structure of the color and the color of the combined number of times - the last because it is a ring of a little more to think about.

inline void Make(int & x , int & y) {
    if(! rev) {
        if(x >= tr + 1) x -= tr ;
        else x = n - tr + x ;
        if(y >= tr + 1) y -= tr ;
        else y = n - tr + y ;
    }
    else {
        if(x <= tr + 1) x = tr - x + 2 ;
        else x = tr + n - x + 2 ;
        if(y <= tr + 1) y = tr - y + 2 ;
        else y = tr + n - y + 2 ;
    } return ;
}

Complexity \ (n \ log n \)

  • P2264 Love Letter

String simulation questions? . .Do not say

  • P3690 [template] Link Cut Tree (dynamic tree)

LCT board (Anyway backplane daughter get away

  • P2147 [SDOI2008] Cave surveying

LCT board a question directly off the edge even edge. . Then \ (the findroot \) determines whether the communication line. .

  • P2173 [ZJOI2012] Network

The idea of violence was built 20 LCT. .
Three operations
to modify a node weights
directly modify the End \ (splay \) about bin
modify the color of one side of
these edges in the original place \ (cut \) off another LCT \ (Link \) as to what occurred Han not appeared (Map \) \ able to save enough not
maximum direct query FIG consisting edge color c, all possible node u to the simple path between nodes in a node v weights \ (split \) find that \ (RMQ \) problem. .

  • P4867 Gty two sequences force sister

I think the data is cancer? . . Then I tried it
Direct Mo team plus Fenwick tree water passed. .

It is to use a \ (cnt \) times the number of occurrences statistics appear to contribute to the increase in time 1 0 to subtract contributions. .

P4271 [USACO18FEB]New Barns

Probably meaning of the questions is to merge the two communication blocks, query point to other points within the maximum distance communication block
direct LCT write up a backhand. . Dynamic maintenance-hand. .

Guess you like

Origin www.cnblogs.com/Isaunoya/p/11764199.html