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

34744번 - 2 Keys Keyboard 서브태스크다국어

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

문제

Imagine a very simple text editor that supports exactly two operations:

  • Copy All : Copy the entire current screen content into the clipboard. (Partial copy is not allowed.)
  • Paste : Paste the content from the clipboard onto the screen.

Initially, the screen contains a single character A. Your goal is to display exactly $N$ characters A on the screen using the minimum number of operations possible. Find the minimum number of operations required when acting optimally.

입력

The first line contains a single integer $N,ドル representing the number of characters A to be displayed. $(1 \leq N \leq 1,000円,000円)$

출력

Print a single integer: the minimum number of operations required.

제한

서브태스크

번호배점제한
180

1ドル \leq N \leq 1,000円$

220

1ドル \leq N \leq 1,000円,000円$

예제 입력 1

9

예제 출력 1

6
  • Step 1: C → Copy A
  • Step 2: P → Screen = AA
  • Step 3: P → Screen = AAA
  • Step 4: C → Copy AAA
  • Step 5: P → Screen = AAAAAA
  • Step 6: P → Screen = AAAAAAAAA

Total steps = 6.

This example satisfies the conditions of Subtask 1 and 2.

예제 입력 2

1

예제 출력 2

0

This example satisfies the conditions of Subtask 1 and 2.

노트

출처

University > 서강대학교 > CSE4152 문제해결프로그래밍실습 > 2025-2학기 중간고사 코딩 테스트 1번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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