16 lines
304 B
Python
Executable File
16 lines
304 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
elves = []
|
|
|
|
with open('input') as f:
|
|
elf = []
|
|
for line in f:
|
|
if line == "\n":
|
|
elves.append(elf)
|
|
elf = []
|
|
else:
|
|
calories = int(line)
|
|
elf.append(calories)
|
|
|
|
print(sum(sorted(map(sum, elves), reverse=True)[0:3]))
|