diff --git a/day06/task1.py b/day06/task1.py index 946b749..1de4102 100644 --- a/day06/task1.py +++ b/day06/task1.py @@ -11,7 +11,7 @@ def do_task(input): for i in range(len(times)): a = -1 - b = 1 + times[i] - 1 + b = times[i] c = -distances[i] max_h = (-b - sqrt(b**2 - 4 * a * c)) / (2 * a) diff --git a/day06/task2.py b/day06/task2.py index 51b6a84..1201db0 100644 --- a/day06/task2.py +++ b/day06/task2.py @@ -8,7 +8,7 @@ def do_task(input): distance = int("".join(lines[1].split()[1:])) a = -1 - b = 1 + time - 1 + b = time c = -distance max_h = (-b - sqrt(b**2 - 4 * a * c)) / (2 * a)