選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

16 行
349B

  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('.'))