day 12 ;)
This commit is contained in:
parent
a071433689
commit
4d69df2df2
18
day12/cheat.py
Normal file
18
day12/cheat.py
Normal file
@ -0,0 +1,18 @@
|
||||
sizes = [7, 7, 7, 6, 7, 5]
|
||||
|
||||
t = 0
|
||||
for line in open("input"):
|
||||
if 'x' in line:
|
||||
line = line.strip()
|
||||
s = line.replace("x"," ").replace(":","").split()
|
||||
n = map(int, s)
|
||||
w, h, *n = n
|
||||
need = sum(sizes[i]*x for i,x in enumerate(n))
|
||||
if need > w*h:
|
||||
print(line, "impossible")
|
||||
else:
|
||||
print(line, "<>", w*h - need)
|
||||
t += 1
|
||||
|
||||
print(t)
|
||||
|
||||
1030
day12/input
Normal file
1030
day12/input
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user