2025 #5
1 changed files with 26 additions and 0 deletions
26
2025-python/output/day_12.py
Normal file
26
2025-python/output/day_12.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
from output import ints
|
||||
|
||||
|
||||
def solve(data):
|
||||
p1 = 0
|
||||
data = data.split("\n\n")
|
||||
Q = data.pop().splitlines()
|
||||
for q in Q:
|
||||
W, H, *C = ints(q)
|
||||
if W * H >= sum(C) * 9:
|
||||
p1 += 1
|
||||
p2 = "God jul!"
|
||||
return p1, p2
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
with open("./input/12.txt", "r") as f:
|
||||
inp = f.read().strip()
|
||||
|
||||
p1, p2 = solve(inp)
|
||||
|
||||
print(p1)
|
||||
print(p2)
|
||||
|
||||
assert p1 == 440
|
||||
assert p2 == "God jul!"
|
||||
Loading…
Add table
Reference in a new issue