You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
250B

  1. states = [[0, 0, 0, 0, 0, 0, 0, 0, 0]]
  2. for n in text.split(','):
  3. states[0][int(n)] += 1
  4. for day in range(256):
  5. states.append(states[-1][1:] + states[-1][:1])
  6. states[-1][6] += states[-2][0]
  7. ans1 = sum(states[80])
  8. ans2 = sum(states[256])