don't do math before breakfast

main
HeNine 12 months ago
parent d9239bbb82
commit b14b77adc0

@ -11,7 +11,7 @@ def do_task(input):
for i in range(len(times)): for i in range(len(times)):
a = -1 a = -1
b = 1 + times[i] - 1 b = times[i]
c = -distances[i] c = -distances[i]
max_h = (-b - sqrt(b**2 - 4 * a * c)) / (2 * a) max_h = (-b - sqrt(b**2 - 4 * a * c)) / (2 * a)

@ -8,7 +8,7 @@ def do_task(input):
distance = int("".join(lines[1].split()[1:])) distance = int("".join(lines[1].split()[1:]))
a = -1 a = -1
b = 1 + time - 1 b = time
c = -distance c = -distance
max_h = (-b - sqrt(b**2 - 4 * a * c)) / (2 * a) max_h = (-b - sqrt(b**2 - 4 * a * c)) / (2 * a)

Loading…
Cancel
Save