Puzzle du 3 décembre 2016
This commit is contained in:
parent
54c54d264a
commit
fdc6510980
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys, re
|
||||
regex = re.compile(r'([0-9]+)')
|
||||
data = [sorted([int(c) for c in regex.findall(line.strip())]) for line in sys.stdin.readlines()]
|
||||
print(sum(1 for triangle in data if triangle[0] + triangle[1] > triangle[2]))
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys, re
|
||||
from itertools import zip_longest
|
||||
regex = re.compile(r'([0-9]+)')
|
||||
data = [zip_longest(*([iter(col)] * 3)) for col in zip(*[[int(c) for c in regex.findall(line.strip())] for line in sys.stdin.readlines()])]
|
||||
print(sum(sum(t[0] + t[1] > t[2] for t in [sorted(t) for t in col]) for col in data))
|
Loading…
Reference in New Issue