Advertisement

LinearKeyboard(simulate):ContainerMapSimulator LinearKeyboard(simulate):ContainerMapSimulator

阅读量:

Linear Keyboard

题面翻译

假设有一个字符串 s ,确保字符串 s 仅由小写字母组成。你需要使用该特殊键盘来输入这个字符串 s

假设键盘的排列顺序是一条 s_2 的直线。

不需要占用任何时间来输入第一个字母;接着,输入后面的每一个字符s_i所需的时长为dist(s_i, s_{i-1})

输出最后需要花费的时间。

dist(a, b) = |a - b|

其中字符 a,b 代表在键盘 s_2 中,ab 的位置相隔的距离。

题目描述

You are provided with a keyboard that comprises 26 keypads. The keypads are arranged in a single row in a specific sequence. Each keypad corresponds to a unique lowercase Latin letter.

You are required to key in the word s on this keyboard. The keyboard exclusively includes only lowercase Latin letters.

Pressing do

全部评论 (0)

还没有任何评论哟~