112 人解决,154 人已尝试。
119 份提交通过,共有 327 份提交。
3.4 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
112 人解决,154 人已尝试。
119 份提交通过,共有 327 份提交。
3.4 EMB 奖励。
创建: 2 年,10 月前.
修改: 2 年,10 月前.
最后提交: 2 周,5 天前.
来源: N/A