您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

11 行
351B

  1. import string
  2. import itertools
  3. abc = ' ' + string.ascii_lowercase + string.ascii_uppercase
  4. common = lambda ss: set.intersection(*map(set, ss))
  5. tally = lambda sss: sum(abc.index(common(ss).pop()) for ss in sss)
  6. lns = open(0).read().splitlines()
  7. print(tally([[ln[:len(ln) // 2], ln[len(ln) // 2:]] for ln in lns]))
  8. print(tally(zip(*[iter(lns)] * 3)))