ZROI 19.08.06 simulation game

Portal

EDITORIAL: In order to protect copyright is Rui topic, here and hold surface title, write only problem solution.


Today is Rui has closed down, deleted from the library to the foot. Tianqi pigeon pigeon txdy!


  • A

"Do not like a schoolboy in a minute up to ask something." - Cai boss

Although the distribution map is indeed very confusing.

So do not read the question carefully, blasting zero two lines of tears.

"This problem will NOIP second question it more difficult." - R Ye

\(30pts:\)

Obviously violence,After understand the meaning of problems\ (O (w \ times h ) \) Simulation can.

\(100pts:\)

Each batons adjacent has the effect that the number of the exchange. So in the end it is still a certain order.

The default position may be switched each, batons removed is equivalent to a root in return.

From a location, look no position to see labels, the ball's trajectory is determined, it can be modified each time \ (O (1) \) operator.

Only for label exchange, by considering only the starting position when looking label.

Code is very short, but \ (7 \) what line I took a writing + \ (2.5h \) , dish died.

Standard regarded treap,That I not stepped on the standard count

R Lord of the exam strategy: \ (min 15 \ \) finished within treap, debug \ (15 \ min \) , about half an hour can be had lost. R Ye nb!


  • B

\(100pts:\)

Obviously the answer is \ (the X-^ 2 \) , where \ (x \) is the number of segments two separate paths.

Found two paths are of equal length, so that two people can synchronize action.

For two paths overlapped portion can be simply determined.

Otherwise, it may assume \ (Y_1 <y_2 \) , that is, the first person on top of the second person.

Obviously the second person above blocks will not be the second person to come, must come from the first person. Thus the number of black spots directly above the first row of the individual can determine where to go next. The second personal empathy.

In accordance with the meaning of the questions can simulate the complexity of \ (O (Tn) \) .


  • C

"I want to be a person of conscience out of question, therefore opened a scalar operators \ (20 \) times the limit." - R Ye

Then Grandpa block bitset money directly * passed, tqlwsl

\(10pts:\)

Direct simulation, each person's information violence dfs count.

\(40pts:\)

For \ (Q = 1 \) inquiry can be reversed do dfs, the latest piece of information when seeking to a certain point, so that this information can be passed to the target point.

For an edge \ ((the X-, the y-) \) , set up a message latest \ (t \) time to \ (y \) is legitimate, considering what time \ (x \) is legal. Apparently \ (t \) this edge before the latest open time.

Complexity \ (O (Q (n-m +)) \) .

\(60pts:\)

In the case of a chain, each point must receive information on a range of tree maintenance can cover each segment of the leftmost point to the rightmost point.

\(100pts:\)

Sol1:

Consider point divide and conquer, seeking contributions through the center of gravity point. Depth-built segment tree, subtree merge to direct segment tree. Each time the calculated center of gravity to the first information, and then can be pushed down from the center of gravity.

Note will be counted weight, you need to subtract its contribution to each of the sub-tree. Complexity \ (O (n-\ log ^ n-2) \) , the card is often required.

Sol2:

Before a rim is broken, the whole communication block information are identical.

And for a tree, broken edges before reconnecting on both sides of the information it is impossible to communicate.

The total number of communication block information recording disconnected when each edge, on both sides directly coupled when recombined, before subtracting the weight recorded value. Obviously correctness.

LCT maintenance complexity \ (O (n-\ log n-) \) .This is obviously good practice ah, give me an hour I had the chances

Note: Sol1 is the original title std, Sol2 R God is found, the original title marked burst stepped count. R Ye tql!

Guess you like

Origin www.cnblogs.com/suwakow/p/11375083.html