포럼
문제 ICPC00325

L. Lucky Draw

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
설명

You and your friends at the Betting against All Probability Club are visiting a casino where the following game is played.

Each of the \(n\) players starts with \(k\) lives and puts in a fixed amount of money. In each round of the game, each player flips a biased coin and loses a life if she gets tails. The game ends when only one player remains, in which case this person wins, or ends in a draw if all remaining players lose their last life in the same round. If there is a winner, she wins \(n\) times her original bet. In case of a draw, no one wins anything.

Being a BAPC member you quickly realize the casino has an edge here: whenever the game ends in a draw all of the contestants lose the money they bet. You are now wondering what exactly is the probability that this game ends in a draw, so you can figure out how much the casino profits on average.

제약
입력 형식
  • One line containing two integers, \(2\leq n\leq 50\), the number of players, \(1\leq k\leq 50\), the number of lives each player has, and a floating point number \(0.1 \leq p \leq 0.9\), the probability the coin lands heads.
출력 형식
  • Output a single floating point number: the probability of the game ending in a draw. Your answer should have an absolute error of at most \(10^{-6}\).
예제 1
입력
2 2 0.5
출력
0.185185185
예제 2
입력
2 2 0.8
출력
0.056241426
예제 3
입력
5 3 0.85
출력
0.045463964
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC BAPC 2019

평가 및 의견

L. Lucky Draw

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

L. Lucky Draw

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8