68 exam simulation summary

T1 violence played, from being Jiecha a priority queue, T2 think of the complexity of violence hesitated for a moment, T3 array harvest a tree seeking reverse swap for six months. .

T1 "priority queue"

First greedy: all the rectangle into a corner is not deteriorated, it is transformed by deleting some of the tuple order, so that the maximum min_x * min_y

It is clearly omitted ascending enumeration of k x (i.e. the tuple min_x omitted), a deleting mk y, but at the same time deleting the x, y may also passing omitted

So how to optimize O (n) statistical answer to violence.

sort pretreatment x, y priority queue maintenance , enumeration k (m-> 0), first m + 1-> n y is in the priority queue, each taking the team top MIN_Y, then X_ {k +1} * min_y update answer every pop top team represents the next will certainly choose to

 

T2 "(tree) Chairman of the tree."

Learning Chairman tree again, hold in the afternoon and finally Biechu a per nxt

All points on the meaning of the questions into all points to the current query path lca min {(r-a_i)}

So dfs establish Chairman tree for each point, and then query each point and nxt to pre lca value of r and the poor do take min

 

Guess you like

Origin www.cnblogs.com/casun547/p/11655802.html