시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 55 | 29 | 29 | 54.717% |
Consider a configurable keyboard where keys can be moved about. An ant is walking on the top row of this keyboard and needs to type a numeric string. The ant starts on the leftmost key of the top row, which contains $9$ keys, some permutation of the digits from $1$ to $9$. On a given second, the ant can perform one of three operations:
Compute the minimum number of seconds needed for the ant to type out the given numeric string, over all possible numeric key permutations.
The single line of input contains a single string $s$ ($1 \le |s| \le 10^5$) consisting only of numeric digit characters from $1$ to $9$. This is the numeric string that the ant needs to type.
Output a single integer, which is the minimum number of seconds needed for the ant to type out the given numeric string, over all possible numeric key permutations.
78432579
20
ICPC > Regionals > North America > Southeast USA Regional > 2020 Southeast USA Regional Programming Contest A번
ICPC > Regionals > North America > Mid-Central Regional > 2020 Mid-Central Regional Programming Contest A번
ICPC > Regionals > North America > Pacific Northwest Regional > 2020 ICPC Pacific Northwest Region > Division 1 G번
ICPC > Regionals > North America > Pacific Northwest Regional > 2020 ICPC Pacific Northwest Region > Division 2 X번
ICPC > Regionals > North America > Mid-Atlantic Regional > 2020 Mid-Atlantic USA Regional Contest C번
ICPC > Regionals > North America > South Central USA Regional > 2020 South Central USA Regional Contest A번