Pure StorageOA #5
Compute Number Score
估计简单可在线判题
考点(AI 标注)字符串模拟/实现
Compute the score of a positive integer n from its decimal representation; the following independent rules may score the same digit more than once: add 2 for each digit 5; add 4 for each pair of adjacent digits 33; for each maximal run in which each digit is exactly 1 greater than the previous one, add L², where L is the run length; add 6 if n is divisible by 5; add 1 for each odd digit.
输入格式
One line containing a positive decimal integer with no sign and no leading zeros. Added by this site: at most 100000 digits.
输出格式
Output the total score.
样例 1
输入:
5
输出:
10
样例 2
输入:
12345
输出:
36
样例 3
输入:
3333
输出:
20