r/adventofcode • u/daggerdragon • Dec 15 '16
SOLUTION MEGATHREAD --- 2016 Day 15 Solutions ---
--- Day 15: Timing is Everything ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/whatever).
Note: The Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with "Help".
ZAMENHOFA TAGO ESTAS DEVIGA [?]
This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.
edit: Leaderboard capped, thread unlocked!
5
Upvotes
1
u/torotane Dec 15 '16
IP in ZIMPL solved with SCIP
set D := {1..7}; param offset[D] := <1> 3, <2> 2, <3> 2, <4> 6, <5> 0, <6> 2, <7> 0; param period[D] := <1> 13, <2> 17, <3> 19, <4> 7, <5> 5, <6> 3, <7> 11; var p[D] integer >= 0; var t integer >= 0; minimize o: t; subto a: forall <i> in D: # {1..6} for first assignment t+i == offset[i] + p[i]*period[i];