blob: c3b51583742032a8c3c3fa4b463b031570cc06fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/usr/bin/env python3
from fileinput import input
from itertools import takewhile
def check(s: str):
return eval(s.replace(": ", ">=9*(").replace("x", "*").replace(" ", "+") + ")")
silver = sum(
map(
check,
takewhile(
bool,
[line.strip() for line in input()][::-1],
),
)
)
print("silver:", silver)
|