codyssi2024/problem1.py
2025-03-14 09:20:40 +01:00

18 lines
241 B
Python

my_input = list(map(int, open("inputs/input_1", "r").readlines()))
p1 = sum(my_input)
p2 = sum(sorted(my_input)[:-20])
p3 = 0
rev = False
for x in my_input:
if rev: x = -x
p3 += x
rev = not rev
print(p1)
print(p2)
print(p3)