Provincial election simulation 2

A. rail construction

  The examination room to play the plug $ DP $, A delusion does not have seven or eight very, but the plug $ dp $ data card is dead, so only the 45.

  Positive Solutions for network flow, similar infinite loop, each point will be split into four directions, as long as the construction is intended to guarantee the key point straight road construction cost of 1, 0 other expenses can then run cost flow can get the answer.

B. Rodeo game

  Examination that is network flow, then the pseudo.

  Correct answer is the shortest path tree? I did not understand.

C. combinatorics

  Up a solution to a problem that Italy transformed to look at Mongolia:

  There are n kinds of balls, each ball has a $ a_ {i} $ a, in accordance with the reference sequence, then the n enumerated arrangement requires for each ball, the ball must be 1 in the top of the same kind of ball, ball No. 1 the same arrangement as that of the enumeration.

  We fitted a prefix and effect, however, and the title to the formula, or different, and more to get rid of a prefix and.

  You can continue the conversion: If you do not require the last ball of No. 1 in the top of the same kind of ball the ball, then arranged the program in question is the number given formula.

  Consider what kind of enumeration last ball, set the ball position for the first time is $ pos $, the ball was $ last $

  Then let $ f_ {i} $ i represents at least bulbs placed behind $ $ Last, this thing binomial inversion scheme can be obtained a valid number.

  Have:

  $f_{i}=\frac{(t+a_{last}-1!}{\Pi b}*\binom{m-pos}{t+a_{last}-1}*\frac{(m-t-a_{last})!}{\Pi c}$

  Where $ b $ $ Last represented on the back of the ball set $, $ c $ denotes the ball in front of the set.

  I found that the only thing the two parts of the ball and the number of relevant, make a backpack would be finished.

Guess you like

Origin www.cnblogs.com/hzoi-cbx/p/12093724.html
Recommended