Files
AdventOfCode2023/06/06-2.py
2023-12-06 15:23:50 +01:00

19 lines
415 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
tim, dis = 0, 0
input_file = open("input", "r")
for line in input_file:
if line.startswith('T'):
tim = int(line.strip().split(":")[1].replace(" ", ""))
if line.startswith('D'):
dis = int(line.strip().split(":")[1].replace(" ", ""))
input_file.close()
wins = 0
for j in range(tim + 1):
if (tim-j) * j > dis:
wins += 1
print(wins)