ZROI 19.08.05 simulation game

Portal

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


  • A

\(21pts:\)

Casual enumeration, just like a burst search.

\(65pts:\)

Comparative apparent DP, provided \ (f_ {i, j, k} \) represents the sub-tree \ (I \) , the two were brought to the selected \ (j, k \) th optimal solution.

Tight bounds for enumeration point card, a polymerization according to the analysis tree backpack, complexity is \ (O (n ^ 3) \) can be produced by.

\(100pts:\)

Observation data rangeIt can be found in the sub-tree size limit this problem can be abstracted into a classic network flow model.

One of the biggest costs of running streams just fine.

I wrote ugly, each point demolition of \ (5 \) points out,But still run fast.


  • B

\(22pts:\)

Enumeration full array / shaped pressure.

\(100pts:\)

This problem is not very good non-positive solutions to write it directly on positive solutions.

What to consider when no solution. Just get out of a spanning tree, if \ (\ SUM a_i <\ SUM w_i \) , apparently no solution.

Now we have to prove that, as long as \ (\ SUM a_i \ geq \ SUM w_i \) , some solvable.

We consider shrink shrink point to a situation, when all sides can not shrink up. At this time, for each edge \ ((u_i, V_I, W_i) \) , are \ (W_i> A_ A_ {+} {u_i V_I} \) .

All inequalities together, we get \ (\ SUM w_i> \ SUM a_i \ cdot dgr_i \ geq \ SUM a_i \) , is clearly inconsistent with our previous assumptions.

So, we have proved that for a spanning tree, as long as \ (\ SUM a_i \ geq \ SUM w_i \) , some solvable. Then obviously take the best minimum spanning tree.

So we consider a satisfying \ (\ sum a_i \ geq \ sum w_i \) tree, how to construct a solution.

First set \ (S_I = a_i + \ sum_ {J \ in subtree_i} a_j-W _ {(J, fa_j)} \) , i.e. \ (I \) all points right point in the tree, and with the edge weights and the difference.

For each point \ (I \) , we calculated that every son \ (J \) a \ (_ {S_j-W (J, I)} \) , provided this value \ (v_J \) , according to \ (v_j \) to its son descending order. ( \ (V_J \) is meaningful in that sub-tree \ (j \) connected to all points on incremental father after the father's right to the point)

For a son \ (J \) , if \ (S_j \ geq 0 \) , the first recursive processing, the son, then the connection between it and the father's side.

Otherwise, the son can not handle their own side of the sub-tree, you need to connect it with the father's side, and then recursively processing sub-tree, and his father passed on the remaining weights.

When in doubt the validity of a connection where only son, due minus the weight of an edge, the weights and may \ (<0 \) .

It found that for (v_i \ geq 0 \) \ point, the connection weights father must make the remaining increase will not affect.

Otherwise, the next point \ (v_i \) are negative. Finally, since the residual weight father \ (\ 0 GEQ \) , then the process continues to decrease not \ (<0 \) .

When implementing, found to affect only a son and (v_i \) \ of positive and negative, and therefore does not need to sort, just sweep twice, first take (v_i \ geq 0 \) \ son, then take \ (v_i <0 \) son can be.

Complexity \ (O (n-\ log n-) \) , wherein the bottleneck when ordering request mst.


  • C

\(6pts:\)

Clearly the answer must be a prime number \ (0 \) .

\(34pts:\)

+ Blast search play table, can be had lost \ (n-\ Leq 100 \) .

\(51pts:\)

seeThe topic and peoplePerfect square, it is easy to think of the quality factor exclusive or linear group.

Maintenance bitset with each prime number, the complexity of the \ (O (\ FRAC. 4 ^ {n-64} {\ ^ 2N} LN) \) , can achieve excellent too \ (n-\ Leq 1000 \) .

\(100pts:\)

Set \ (g (x) \) is \ (x \) recently found the number to the left, that is (f (x) \) \ meaning similar, but in the opposite direction function.

We found \ (f (x) \) and \ (g (x) \) mutually inverse function.

Proof: Suppose the \ (f (x) \) first position left to find \ (Y> X \) , then we find the two sequences symmetric difference is taken (i.e., exclusive OR), the obtained new sequences are also perfect square, found that as \ (f (x) \) in the two sequences are in there, and \ (x \) appears only once, so you can find a left point \ (x \) , right point \ (<f (x) \ ) sequence, and \ (f (x) \) is to find the right number of recent conflicts.

That is, each composite number has one and only one with a different solution, and the answer is \ (G (the X-) \) .

From \ (X \) forward sweep, was added each time a \ (L \) , to see if linearly independent. Complexity \ (O (\ frac {n ^ 3} {64 \ ln ^ 2n}) \), It seems no use.

It found that more than \ (\ sqrt n \) primes only have one, you can look online special sentenced substrate.

Not more than \ (1000 \) prime numbers only \ (168 \) a complexity \ (O (\ FRAC {168 ^ 2 \ Times n-} {128}) \) , due to the fact run dissatisfied (such answer is not more than \ (\ FRAC n2 \) ), it can be over.

Guess you like

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