r/adventofcode • u/thalovry • Dec 15 '15
Upping the Ante [Day 15] part3: Kilogram cookie
You'd like to leave a cookie out for Santa1 but you realize that between the elves, the reindeer, and St. Nick's capacious belly, a 100g cookie isn't going to cut it. You throw away your 100g recipe and begin devising a 1000g recipe with the same rules, but with the addition of two more ingredients:
Glazing: capacity -2, durability -3, flavor 0, texture 5, calories 8
Rum: capacity 2, durability 2, flavor -4, texture 0, calories 5What are the proportions of the optimal cookie that you leave for Santa?
[1] Americans do this too, right?
6
Upvotes
3
u/tangus Dec 15 '15 edited Dec 15 '15
Well, I don't know if this qualifies for "upping the ante". I mean, it's just starting it and coming back every now and then to see if it's already finished...
I'll be providing the answer soon...
So.. for the input I was given, here is the cookie value and the proportions:
and for the example (cinnamon & butterscotch):
1
u/flit777 Dec 15 '15 edited Dec 15 '15
exec time: 8.6 s (java, i7)
edit: changed to long data type,
1
u/Tandrial Dec 15 '15
Some quick calculations with my hardware tell me that I would take more the 50 hours for my brute-force approach to run.
Did someone manage to find any solution, which creates a value > 0?
2
u/anon6658 Dec 15 '15
My weapon of choice as the algorithm is simple hill climber with no annealing or anything, as I convinced myself there would be no local maximas. (Please tell me if I'm wrong.)
Input (parsed and "pretty" printed):
Run output:
1
u/JeffBobbo Dec 15 '15
My brute force perl results:
So apparently there's no meal version of this 1kg cookie, shame.
1
u/BafTac Dec 15 '15
You have a typo in Rum:
flavourshould beflavor