aoc2022/d11/part1.py

18 lines
378 B
Python

import sys
mod = __import__(sys.argv[1])
M = mod.M
for r in range(20):
for k,m in enumerate(M):
items = m[0]
m[3] += len(items)
for _ in range(len(items)):
i = items.popleft()
ni = m[1](i) // 3
nm = m[2](ni)
M[nm][0].append(ni)
L=list(m[3] for m in M)
print(L)
LS=list(sorted(L))
print(LS[-1]*LS[-2])