| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 40 초 (추가 시간 없음) | 1024 MB | 9 | 3 | 3 | 100.000% |
You want to create a certain target string S, which consists only of lowercase English letters. You start with an empty string, and you are allowed to perform the following operations:
What is the smallest number of operations needed to create your target string? Note that you must create exactly the target string, with no additional letters.
The first line of the input gives the number of test cases, T. T lines follow. Each line contains the target string S.
For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the minimum number of operations (as described in the problem statement) needed to create the target string.
a through z.3 abcabab aaaaaaaaaaa vnsdmvnsnsdmkvdmkvnsdmk
Case #1: 6 Case #2: 7 Case #3: 15
The optimal solution for Sample Case #1 is:
a.b.c.ab to the clipboard.ab at the end of the string.ab at the end of the string.The optimal solution for Sample Case #2 is:
a.a.a.aaa to the clipboard.aaa at the end of the string.aaaaa to the clipboard.aaaaa at the end of the string.Contest > Google > Kick Start > Google Kick Start 2017 > Round E B번