There are $ a $ ordinary balls, $ b $ super ball, there are $ n $ th to capture the treasure can dream, for the first $ i $ a treasure can dream of an ordinary ball capture probability is $ p_i $, super ball catch probability is $ u_i $, each can only throw a ball to the same treasure can dream the same dream can be a treasure can throw two kinds of balls. Then ask the number of captures in the optimal policy expectations
Consider the probability of $ dp $, we found that the state can not be reduced to $ n ^ 2 $ level,It is not dp
Assume that each treasure can only be a dream to throw a ball that matches the problem, set $ A $ as an ordinary ball, $ B $ super ball, the source point to the $ A $, $ B $ and even the capacity of the ball number, cost of $ 0 $ side, $ a, B $ respectively each sprite even a capacity of $ 1 $, cost is $ P_i $ or $ u_i $ edges and each sprite to sink even capacity of $ 1 $ at a cost of $ 0 $ sides, the biggest cost is the cost flow of the answer.
Since a wizard can simultaneously throwing two balls, when he threw two balls, the probability of capture is $ 1- (1-p_i) times (1-u_i) $, simplification was $ p_i + u_i-p_i times u_i $ , this is actually the equivalent of $ a, B $ while the capacity of $ 1 $ flows through this wizard, if there is no $ p_i times u_i $ each sprite can be connected to the sink two sides, each side capacity of $ 1 $ and the cost is $ 0 $, however, to deal with this $ p_i times u_i $ can be considered one of the two sides in the cost changed to $ -p_i times u_i $, because the maximum cost flow path of the longest running time will certainly take priority spending $ 0 $ the piece, walk $ -p_i times u_i $ of this, while walking two and only when the two balls are thrown at the same time a wizard, and this time the cost just for the $ p_i + u_i-p_i times u_i $, is proved.
|
|
原文:大专栏 cf739E Gosha is hunting (flows)