110 人解决,153 人已尝试。
114 份提交通过,共有 317 份提交。
3.5 EMB 奖励。
单点时限: 1.0 sec
内存限制: 256 MB
Given a string $S$ only contains lower-case Latin letters, you can perform the following operations on $S$ any number of times:
Select a non-empty contiguous substring of $S$ and replace the current character with its next character, specifically, when the current character is z
, replace it with a
.
For example: abcabc
, choose the interval $[1,6]$ and the result of one operation is bcdbcd
.
Your goal is to find the minimum number of operations required to make $S$ contains only one type of lower-case Latin letter.
Restriction: The number of operations on each position can not exceed 25.
A string $S\ (|S|\le 10^5)$ as required.
Output one number — the minimum number of operations required to make $S$ contains only one type of lower-case Latin letter.
abc
2
abz
3
110 人解决,153 人已尝试。
114 份提交通过,共有 317 份提交。
3.5 EMB 奖励。
创建: 1 年,9 月前.
修改: 1 年,9 月前.
最后提交: 1 年,2 月前.
来源: N/A