Logo
(追記) (追記ここまで)

24604번 - Black and White 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 1024 MB67474277.778%

문제

Black and White is a Chinese children's game played in rounds. During each round, the children who are playing all put their hands in either face-up ("White") or face-down ("Black"). If all the children but one make the same choice, then the "odd one out" sits out for the rest of the game. Play continues until there are only two children left.

Each child independently chooses whether to put their hand face-up with their own fixed probability. What is the expected number of rounds that such a game will last?

입력

The first line contains a single integer $n$ (2ドル \le n \le 20$), which is the number of children.

Each of the next $n$ lines contains a single real number $p$ (0ドル.1 \le p \le 0.9$). These are the probabilities for each child that they will put their hand in face-up. The probabilities will have at most three digits after the decimal point.

출력

Output a single real number, which is the expected number of rounds. The result must be accurate to within an absolute or relative error of 10ドル^{-6}$.

제한

예제 입력 1

3
0.5
0.5
0.5

예제 출력 1

1.3333333

예제 입력 2

3
0.3
0.3
0.3

예제 출력 2

1.5873015

예제 입력 3

5
0.1
0.3
0.5
0.7
0.9

예제 출력 3

7.4752846

힌트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2021 ICPC Pacific Northwest Region > Division 2 P번

ICPC > Regionals > North America > South Central USA Regional > 2021 South Central USA Regional Contest > Division 1 A번

ICPC > Regionals > North America > South Central USA Regional > 2021 South Central USA Regional Contest > Division 2 B번

ICPC > Regionals > North America > Mid-Central Regional > Mid-Central USA Programming Contest 2021 B번

ICPC > Regionals > North America > Southeast USA Regional > 2021 Southeast USA Regional Programming Contest > Division 1 A번

ICPC > Regionals > North America > Southeast USA Regional > 2021 Southeast USA Regional Programming Contest > Division 2 B번

  • 문제를 만든 사람: Arnav Sastry
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /