시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
4 초 (추가 시간 없음) | 1024 MB | 52 | 35 | 32 | 68.085% |
You are writing code for a hackathon where you need to decode Binary ALGOL Punch Cards. You have already come up with the optimal solution and only need to type it out. The solution consists of $c$ characters, and your typing speed is $1$ character per time unit. However, your computer is prone to sudden crashes: after every character you type there is a probability of $p$ that your computer crashes and you need to start over again. Recovering after a crash costs $r$ time units, and you can then continue typing from the last point where you saved your code.
You can click "Save" at any time (which costs $t$ time units) to save your code and to be able to restart from this point after crashes. Clicking "Save" will not cause your computer to crash.
Determine how many (expected) time units you need to complete the code. Note that the code should be saved after typing the last character.
The input consists of:
Output the expected number of time units you need to complete the code.
Your answer should have an absolute or relative error of at most $10^{-6}$.
2 1 5 0.25
8.0
3 5 2 0.5
26.0
10 4 5 0.327
68.664967357
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2022 C번