03
This commit is contained in:
28
03/03-1.py
Normal file
28
03/03-1.py
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
file = "./input.txt"
|
||||
from time import time
|
||||
start_time = time()
|
||||
|
||||
def check_line(l:str)->bool:
|
||||
l=sorted(list(map(int,l.split())))
|
||||
if l[0]+l[1] > l[2]:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
if __name__ == "__main__":
|
||||
sol = 0
|
||||
input_file = open(file, "r")
|
||||
for line in input_file:
|
||||
line = line.strip()
|
||||
if line == "":
|
||||
continue
|
||||
else:
|
||||
if check_line(line):
|
||||
sol += 1
|
||||
input_file.close()
|
||||
|
||||
print(f"Solution - Part1: {sol}")
|
||||
print(f'Runtime: {time()-start_time:.4f} s')
|
||||
Reference in New Issue
Block a user