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

25928번 - Lightbulbs 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB148675.000%

문제

Thomas Edison is actively working on a better version of a lightbulb. During that process, he covers entire fields with batches of lightbulbs and conducts tests on them. In his current experiment, he arranged $N$ rows with $M$ lightbulbs in each row. Each lightbulb has a chance $P$ of working, otherwise, it’s faulty and won’t light up. Thomas wants to find the expected value of the length of the longest horizontal sequence of lightbulbs that are working.

For example, in the setup below, where 1ドル$ is a working lightbulb and 0ドル$ is faulty, the length of the longest horizontal sequence of lightbulbs that are working is 3ドル,ドル since there are three consecutive ones in the second row (and also in the fourth row).

1 0 1 1
0 1 1 1
0 1 0 0
1 1 1 0
1 1 0 1

Note that we’re interested in horizontal sequences only.

입력

You’re given three numbers separated by spaces – positive integers $N$ and $M,ドル and a real number $P$.

출력

Output the answer to the problem. Your answer would be considered correct if its absolute or relative error is less than 10ドル^{-4}$.

제한

  • 1ドル ≤ N, M ≤ 2000$
  • 0ドル ≤ P ≤ 1$

예제 입력 1

2 3 0.5

예제 출력 1

1.828125000000

예제 입력 2

47 74 1

예제 출력 2

74.000000000000

힌트

출처

Contest > Waterloo's local Programming Contests > 2022 Waterloo Fall Local B번

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

출처

대학교 대회

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

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