No.1682 Unfair Game
タグ : / 解いたユーザー数 94
作問者 :
Sumitacchan
/ テスター :
👑
hitonanode
Problem Statement
There are $N$ coins, numbered from $1$ to $N$.
Because these coins have special shapes, when the $i$-th coin is tossed at random, the probability of landing heads is $\displaystyle{\frac{P_i}{100}}$ and the probability of landing tails is $\displaystyle{\frac{100-P_i}{100}}$.
Alice and Bob choose $1$ or more coins from among these and play the following game.
- Toss all the chosen coins at random.
- If the number of coins that landed heads is odd, Alice wins; if it is even, Bob wins.
There are $2^N-1$ ways to choose the coins. Among them, how many ways make the probability of Alice winning strictly greater than $1/2$?
Since the answer can be very large, output it modulo $10^9+7$.
Input
$N$ $P_1\ \ P_2\ \ \cdots\ \ P_N$
- $1\le N\le 100$
- $0\le P_i \le 100$
- All inputs are integers.
Output
Output the number of ways to choose the coins such that the probability of Alice winning is strictly greater than $1/2$, modulo $10^9+7$.
Sample
Sample 1
Input
2 30 80
Output
2
- If only coin $1$ is chosen, the probability of Alice winning is ${30}/{100}\ (\le 1/2)$.
- If only coin $2$ is chosen, the probability of Alice winning is ${80}/{100}\ (> 1/2)$.
- If both coins are chosen, the probability of Alice winning is ${6200}/{10000}\ (> 1/2)$.
Sample 2
Input
1 50
Output
0
Note that cases where the probability of Alice winning is exactly $1/2$ are not included in the answer.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。