aoc2023/d06/part2.py

11 lines
197 B
Python
Raw Permalink Normal View History

2023-12-06 09:01:43 +00:00
import sys
(t,r) = (int(sys.argv[1]), int(sys.argv[2]))
print(
# i : time of charging, between 0 and t
# v = i # speed in m/s
# d = v * (t-i) # distance
sum(i*(t-i) > r for i in range(t))
)