UVa11021
Posted Yan_Bin
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了UVa11021相关的知识,希望对你有一定的参考价值。
11021 Tribbles
GRAVITATION, n.
“The tendency of all bodies to approach one another with a strength
proportion to the quantity of matter they contain – the quantity of
matter they contain being ascertained by the strength of their tendency
to approach one another. This is a lovely and edifying illustration of
how science, having made A the proof of B, makes B the proof of A.”
Ambrose Bierce
You have a population of k Tribbles. This particular species of Tribbles live for exactly one day and
then die. Just before death, a single Tribble has the probability Pi of giving birth to i more Tribbles.
What is the probability that after m generations, every Tribble will be dead?
Input
The first line of input gives the number of cases, N. N test cases follow. Each one starts with a line
containing n (1 n 1000), k (0 k 1000) and m (0 m 1000). The next n lines will give the
probabilities P0; P1; : : : ; Pn
以上是关于UVa11021的主要内容,如果未能解决你的问题,请参考以下文章