Initial commit.
This commit is contained in:
27
01/a.py
Normal file
27
01/a.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
f = open("input.txt", "r")
|
||||||
|
|
||||||
|
elves = []
|
||||||
|
|
||||||
|
i = 0
|
||||||
|
n = 0
|
||||||
|
|
||||||
|
for x in f:
|
||||||
|
if x.strip():
|
||||||
|
n = n + int(x)
|
||||||
|
else:
|
||||||
|
i = i+1
|
||||||
|
elves.append(n)
|
||||||
|
n = 0
|
||||||
|
elves.append(n)
|
||||||
|
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
elves.sort()
|
||||||
|
|
||||||
|
top = elves[len(elves)-1]
|
||||||
|
|
||||||
|
top3 = elves[len(elves)-1] + elves[len(elves)-2] + elves[len(elves)-3]
|
||||||
|
|
||||||
|
print(top)
|
||||||
|
|
||||||
|
print(top3)
|
||||||
2244
01/input.txt
Normal file
2244
01/input.txt
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user