comment 10-2, w/ explanation

This commit is contained in:
2025-12-10 19:28:19 +00:00
parent f053bc804c
commit 5e74d7dcd9

View File

@@ -1,4 +1,13 @@
from pulp import LpProblem, LpVariable, LpMinimize, lpSum, PULP_CBC_CMD from pulp import LpProblem, LpVariable, LpMinimize, lpSum, PULP_CBC_CMD
"""
ok to clarify the solution here:
modelling this as ilp ->
variable for each button representing how many times it is pressed - minimize this!
constraints for each joltage thingy? idk - (buttons that increment it * number of times pressed) *must equal goal so it matches expected value*!
if button doesnt increment 0 * wtv is still 0 so doesnt matter
boom done city
"""
def solve(goal, buttons): # hence another thing i havent done in years def solve(goal, buttons): # hence another thing i havent done in years
prob = LpProblem("Operation_Dumbass_Elves", LpMinimize) prob = LpProblem("Operation_Dumbass_Elves", LpMinimize)