题目:
import os import sys import math import re from bisect import * from heapq import * input =lambda:sys.stdin.readline().rstrip('\r\n') def I(): return input() def II(): return int(input()) def LII(): return list(map(int,input.split())) # 请在此输入您的代码 def solve(): s = I() n = len(s) f = [[0 for j in range(2)]for i in range(n+1)] f[0][0] = 0 f[0][1] = ord(s[0])-ord('a')+1 for i in range(1,n): f[i][0]=max(f[i-1][1],f[i-1][0]) f[i][1]=max(f[i-2][1],f[i-2][0])+ord(s[i])-ord('a')+1 print(max(f[n-1][1],f[n-1][0])) for _ in range(1):solve()
标签:return,range,input,序列,import,ord,松散,def From: https://www.cnblogs.com/cancanneed/p/18045591