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

19294번 - Dynamic Input Tool 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB107770.000%

문제

CodingSlave 1.0 is a brand new text editor. There are two possible operations to compose a string in CodingSlave 1.0:

  1. Add one character at the end of the current string.
  2. Choose a nonempty subsequence of the current string and add it at the end of the current string.

Initially, the current string is empty.

Given a word consisting of lowercase English letters, calculate the minimum number of operations needed to compose this string.

입력

The first line contains a string $S$ consisting of lowercase English letters (1ドル \le |S| \le 10^6$).

출력

Print one integer: the minimum number of operations needed to compose $S$ using CodingSlave 1.0.

제한

예제 입력 1

aaa

예제 출력 1

3

예제 입력 2

aabaaaabaa

예제 출력 2

5

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2018 > Day 5: Grand Prix of Korea D번

Contest > Open Cup > 2017/2018 Season > Stage 10: Grand Prix of Korea D번

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

출처

대학교 대회

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

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