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

4 年前
123456789101112131415
  1. import sys
  2. def march(text):
  3. base = '.' + text + '.'
  4. for i in range(len(text)):
  5. yield '.^'[base[i:i + 3] in {'^^.', '.^^', '^..', '..^'}]
  6. text = sys.stdin.read().strip()
  7. seen = [text]
  8. for i in range(400_000):
  9. seen.append(''.join(march(seen[-1])))
  10. print(''.join(seen[:40]).count('.'))
  11. print(''.join(seen[:400_000]).count('.'))