"Exam" 40 provincial election

T1
is the question of thinking.
We all points of less than 3 degrees off reduction of all sides and then remove Points to the edge of the answers can be multiplied by the corresponding contribution.
With \ (set \) and \ (bfs \) to maintain it.
Time complexity \ (O (nlogn) \)
code is too much trouble.
Learned a trick:
\ (the mutable \) type: mutable variables.
If (SET \) \ a size of a character definition and elements contained in the element \ (the mutable \) type independent variable, then the variable is directly \ (SET \) changes in.
This saves constant.
So that we do not need to go out then add elements.

T2
If we number per day are enumerated, it is equivalent to a length of the enumeration \ (m \) , and for the \ (n-\) sequence \ (A \) .
There are:
\ [a_i \ in [0, n-] \]
\ [\ the begin {the aligned} ANS & = \ Prod \ Limits _ {\ {A \}, \ SUM a_i = n-} (UI + V) ^ {a_i} \ \ & = \ sum \ limits_ {
i = 0} ^ {n} (u + v) ^ i (2u + v) ^ {ni} \\ \ end {aligned} \] we set:
\ [UI + = W_i V \]
so \ (m \) day answer generating function is:
\ [\ the begin {the aligned} F_m (X) & = \ Prod \ limits_ {I =. 1} ^ {m} \ SUM \ limits_ {J = 0 } ^ {+ \ infty} (
w_ix) ^ j \\ & = \ prod \ limits_ {i = 1} ^ {m} \ frac {1} {1-w_ix} \\ \ end {aligned} \] look day situation:
\ [\ {FRAC. 1. 1-w_1x} {} \ {FRAC-w_2x. 1. 1}} = {\ left (\ {FRAC. 1. 1-w_1x} {} - \ FRAC. 1} {{l- w_2x} \ right) \ frac { 1} {ux} = \ frac {\ frac {1} {ux}} {1-w_1x} - \ frac {\ frac {1} {ux}} {1-w_2x} \ ]
corresponds to this form of:
\ [F_m (x) = \
sum \ limits_ {i = 1} ^ {m} a_ {m, i} \ frac {1} {1-w_ix} \] then we make an incremental configuration:
\ [\ the begin {aligned} F_m (x) & = F_ {m-1} (x) \ frac {1} {1-w_mx} \\ & = \ sum \ limits_ {i = 1} ^ {m-1} a_ {m -1, i} \ frac {1 } {1-w_ix} \ frac {1} {1-w_mx} \\ & = \ sum \ limits_ {i = 1} ^ {m-1} a_ {m-1, i} \ left (\ frac { 1} {1-w_ix} - \ frac {1} {1-w_mx} \ right) \ frac {1} {(im) ux} \\ & = \ frac {1} { (ux) ^ {m-1 }} \ sum \ limits_ {i = 1} ^ {m-1} \ frac {a_ {m-1, i}} {(1-w_ix) (im)} + \ frac {a_ {m-1, i
}} {(1-w_mx) (mi)} \\ \ end {aligned} \] then we can get \ (a_ {i, j} \) is a recursive formula.
\ [a_ {i, j} = \ begin {cases} \ frac {a_ {i-1, j}} {ji} & i \ not = j \\ \ sum \ limits_ {j = 1} ^ {m-1 } \ frac {a_ {i-
1, j}} {ij} & i = j \\ \ end {cases} \] then set \ (g_i = a_ {i,
i} \) then there is:
\ [A_ {I , j} = g_j \ frac!
{(- 1) ^ {ij}} {(ij)} \] with the above recurrence formula can be obtained this formula.
Thus we \ (a_ {i, j} \)Substituting to seek other \ (G \) , so that by \ (G \) obtaining \ (G \) , we get a function that generates a recursive formula.
\ [g_i = \ sum \ limits_ {j = 1} ^ {i-1} \ frac {a_ {i-1, j}} {ij} = \ sum \ limits_ {j = 1} ^ {m-1} \ frac {g_j (-1) ^
{ij-1}} {(ij)!} \] provided \ (G (x) = \ sum \ limits_ {i = 1} ^ {+ \ infty} g_ix ^ i \ ) , \ (R & lt (X) = \ SUM \ limits_ {I =. 1} ^ {+ \ infty} \ FRAC {(-. 1) ^ {I-. 1}} {! I} =. 1-E ^ {- X } \)
so according to the above formula have the self-convolution:
\ [G (X) = G (X) R & lt (X) + X \]
as a key value so not to \ (X + \) .
What can be pushed:
\ [^ {E - X} G (X) = X \]
then:
\ [G (X) = X ^ XE \]
Therefore:
\ [G_i = [X ^ I] G (X ) = (i-1)!
\] so that we can consider direct statistical answer.
\ [\ Begin {aligned} ans & = [x ^ n] F (x) \\ & = \ frac {1} {(ux) ^ {m-1}} [x ^ n] \ left (\ sum \ limits_ {i = 1} ^ {m } \ frac {a_ {m, i}} {1-w_ix} \ right) \\ & = \ frac {1} {u ^ {m-1}} [x ^ {n + m-1}] \ left (\ sum \ limits_! {i = 1} ^ {g_i} \ frac {(- 1) ^ {mi}} {(mi)} \ sum \ limits_ {j = 0} ^ {+ \ infty} (w_ix) ^ j \ right) \\ & = \ frac {1} {u ^ {m-1}} \ sum \ limits_ {i = 1} ^ {m} \ frac {(- 1 ) ^ {mi} (ui +
v) ^ {n + m-1}} {(i-1)! (mi)!} \\ \ end {aligned} \] so we can directly \ (O ( nlog10 ^ 9) \) the statistical answer.
Solution to a problem which is a method of inclusion and exclusion.
Although not want to push but it seems very good.
This is my generation function + violent push method but want good very bad push.

T3
a network flow.
Personal understanding is:
This is a construction view showing that the sides of the intermediate have not been cut when flowing freely selected from a color expressed can be.
Because both sides of the case 1. The flow rate must be greater than equal to
represent can choose.
Cut off both sides expressed a certain day is inevitable choose this color.
This ensures that the maximum number of the bipartite graph matching happened.

Guess you like

Origin www.cnblogs.com/Lrefrain/p/12444503.html