포럼
문제 ICPC00341

C. Crashing Competition Computer

설명

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:
- One line with three integers \(c\), \(t\), and \(r\) (\(1 \leq c \leq 2000\), \(0 \leq t, r \leq 10^9\)), indicating the number of characters, the time cost of clicking "Save", and the time cost of recovering after a crash.
- One line with a floating-point number \(p\) (\(0.001 \leq p \leq 0.999\), with at most \(10\) digits after the decimal point), the probability that your computer crashes after a character press.

출력 형식

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}\).

예제 1
입력
2 1 5
0.25
출력
8.0
예제 2
입력
3 5 2
0.5
출력
26.0
예제 3
입력
10 4 5
0.327
출력
68.664967357
문제 정보

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

출처 ICPC BAPC 2022

평가 및 의견

C. Crashing Competition Computer

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

Log in to rate problems.

개별 의견

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

풀이 제출

C. Crashing Competition Computer

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