-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd6p1
More file actions
26 lines (24 loc) · 710 Bytes
/
d6p1
File metadata and controls
26 lines (24 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def main():
times = []
distances = []
win_count = [0, 0, 0, 0]
with open("input6.txt", "r") as input:
s = input.readlines()
for time in s[0][6:].split(" "):
if time != "":
times.append(int(time))
for distance in s[1][9:].split(" "):
if distance != "":
distances.append(int(distance))
for i in range(4):
localtime = times[i]
record = distances[i]
for x in range(localtime):
if (x * (localtime - x)) > record:
win_count[i] = win_count[i] + 1
total = 1
for win in win_count:
total *= win
print(total)
if __name__ == "__main__":
main()