19 lines
393 B
Python
19 lines
393 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
INPUT_FILE = 'input'
|
||
|
|
||
|
def main():
|
||
|
content = list(map(str.strip, open(INPUT_FILE, 'r').readlines()))
|
||
|
elfs = []
|
||
|
cal_sum = 0
|
||
|
for line in content:
|
||
|
if line == '':
|
||
|
elfs.append(cal_sum)
|
||
|
cal_sum = 0
|
||
|
continue
|
||
|
cal_sum += int(line)
|
||
|
elfs.sort()
|
||
|
print(sum(elfs[-3:]))
|
||
|
if __name__ == '__main__':
|
||
|
main()
|