問題一覧 > 通常問題

No.1682 Unfair Game

レベル : / AI推定難易度 : 1350 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 94
作問者 : Sumitacchan / テスター : 👑 hitonanode ygussany
お気に入りにしたユーザー ProblemId : 6805 / 自分の提出
問題文最終更新日: 2021-08-29 18:22:17
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 314 (順位表) の他の問題:

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)$.
Therefore, the answer is $2$ ways.

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もしくは右上の雲マークをクリックしてアカウントを作成してください。