(Sure enough, the title description harmless to humans and animals, the more frenzied the difficulty of the subject)
(T2 feel much force the exercise of my code)
T1 spicy chicken
He saw himself as the subject appears in the title race simulation, my heart very excited
Title reading surface, a N ^ 2 has been formed ideas violence
Then start trying desperately to positive solutions ...
I can not think ah, the time off so fast ...
Bar code ...
A code of violence are an hour ah, cold ....
Spicy chicken ...
A positive solution is the violence ... ..
Directly inside the rectangle count
Just consider the adjacent external circumstances
First sort pruning again, there may be only enumerate rectangular horizontal axis intersection
(NlogN solution does exist, but DeepinC & skyh playing for a long time was disgusting)
T2 devil cancer questions will not
T2 Templates
I ask God What is kat big sucker template problem?
Tree heuristic merge.
Small and large data structures and different heuristic merger, consolidation is heavy tree heuristic information retention son, the son of light information violence
Probably process: first dfs again pre-sub-tree size, weight and other information son
Second dfs, first recursion to solve Light Light Son Son inquiry
Light data is not retained son (empty), recurrent heavy to heavy son asked his son to solve
Heavy data retention son, on this basis, the storm swept all leptons tree, get an answer father
This algorithm must be based on the information the parent node is superimposed byte basis point information (or can inherit otherwise) on
Optimization is a way to minimize the enumeration, increase the use of multiple information
Complexity analysis:
We will sweep the entire sub-tree node father asked if solved, relatively good data at random, because every time the scale of the problem will be reduced by about half
Complexity nodes × average depth
T3 Gangster
You must first know a day spent expectations are the same, then this problem is over
I did not expect the exam, very eat shit.
deepinc: Under one possible scenario, we single day and the day before the lateral view there is indeed a limit of mutual relations
However, if we put all the programs are listed, filled a blackboard
You will find the arrangement difficulty of the subject one day appearing probability are equal
Although each lateral clamp, but random from a longitudinal point of view the question, they do not affect the mutual relation clamped desired equivalence
Well we get to this conclusion, it requires only a single day is like thinking