代码:
ph={'a':1,'b':2,'c':3,
'd':1,'e':3,'f':3,
'g':1,'h':2,'i':3,
'j':1,'k':2,'l':3,
'm':1,'n':2,'o':3,
'p':1,'q':2,'r':3,'s':4,
't':1,'u':2,'v':3,
'w':1,'x':2,'y':3,'z':4,
' ':1}
st=input()
a=0
for i in st:
a+=ph[i]
print(a)
输入1:i have a dream
预期输出1:23
实际输出1:25
输入2:i see dead people(来自https://www.luogu.com.cn/discuss/32320)
预期输出2:31
预期输出2:36
提交结果很惨,RE×9,WA×1,爆零,链接:https://www.luogu.com.cn/record/135112772
救我!