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.

p06.py 260B

3 years ago
3 years ago
3 years ago
3 years ago
12345678910
  1. states = [[0, 0, 0, 0, 0, 0, 0, 0, 0]]
  2. for n in open(0).read().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. print(sum(states[80]))
  8. print(sum(states[256]))