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

32541번 - Expected Error 다국어

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

문제

You are typing your password at a sudo prompt, but suddenly, one of your fingers slipped onto a wrong key. Because the terminal hides the characters that you type, you are uncertain whether you have typed an extra character. To finish typing your password, you consider three possible strategies.

  1. Continue to type the rest of your password.
  2. Press backspace to delete the last character and type the rest of your password.
  3. Restart typing your password from scratch.

To determine the optimal strategy, make use of the following typing speed assumptions.

  • Typing any character of your password takes 0ドル.1$ seconds.
  • Pressing backspace or submitting your password also takes 0ドル.1$ seconds.
  • To restart typing your password, you delete all characters, which takes 0ドル.3$ seconds.
  • If you submit the wrong password, it takes an additional 0ドル.3$ seconds to realize and start typing your password at a new, empty prompt.

You are given the number of characters in your password $n,ドル the number of correctly typed characters $k$ before your finger slipped, and a probability of $p\%$ indicating the likelihood that you pressed a wrong key and ended up with $k+1$ characters. Assuming you make no further errors, determine which strategy yields the lowest expected time to finish typing your password.

입력

The input consists of:

  • One line with three integers $n,ドル $k,ドル and $p$ (1ドル\leq n\leq1000,ドル 1ドル\leq k\leq n,ドル 0ドル\leq p\leq100$), the number of characters in your password, the number of characters you correctly typed before your finger slipped, and the probability percentage that you pressed a wrong key.

출력

Output one of the strings "continue", "backspace", or "restart" indicating the optimal strategy. It is guaranteed that the expected time of the optimal strategy is at least one millisecond shorter than the other strategies.

제한

예제 입력 1

10 8 20

예제 출력 1

continue

예제 입력 2

10 8 80

예제 출력 2

backspace

예제 입력 3

10 2 50

예제 출력 3

restart

예제 입력 4

10 4 55

예제 출력 4

restart

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2024 Preliminaries E번

  • 문제를 만든 사람: Mike de Vries
(追記) (追記ここまで)

출처

대학교 대회

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

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