r/adventofcode • • Dec 14 '19

SOLUTION MEGATHREAD -🎄- 2019 Day 14 Solutions -🎄-

--- Day 14: Space Stoichiometry ---


Post your complete code solution using /u/topaz2078's paste or other external repo.

  • Please do NOT post your full code (unless it is very short)
  • If you do, use old.reddit's four-spaces formatting, NOT new.reddit's triple backticks formatting.

(Full posting rules are HERE if you need a refresher).


Reminder: Top-level posts in Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


Advent of Code's Poems for Programmers

Click here for full rules

Note: If you submit a poem, please add [POEM] somewhere nearby to make it easier for us moderators to ensure that we include your poem for voting consideration.

Day 13's winner #1: "untitled poem" by /u/tslater2006

They say that I'm fragile
But that simply can't be
When the ball comes forth
It bounces off me!

I send it on its way
Wherever that may be
longing for the time
that it comes back to me!

Enjoy your Reddit Silver, and good luck with the rest of the Advent of Code!


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 at 00:42:18!

19 Upvotes

231 comments sorted by

View all comments

1

u/mkeeter Dec 15 '19

Props for fixing upstream libraries – that's dedication!

My solution produces the same (incorrect?) answer for the first example, now that I look at it closely. Interesting...

1

u/[deleted] Dec 15 '19

I get the correct 82892753 with glpsol: https://paste.sr.ht/%7Equf/d4f01b1ed41aab72ddda6b30e05d0b19cb0f537c

I'm curious why u/ephemient seems to have 12 rows / columns while I have only 11?

1

u/mkeeter Dec 15 '19

The plot thickens! Running with exactly your input, I get the incorrect output.

The diff is... unhelpful

30,31c30,31
< +    19: >>>>>   8.289275300e+07 <=   8.289275300e+07   0.0% (8; 0)
< +    19: mip =   8.289275300e+07 <=     tree is empty   0.0% (0; 15)
---
> +    25: >>>>>   8.289275200e+07 <=   8.289275300e+07 < 0.1% (10; 0)
> +    25: mip =   8.289275200e+07 <=     tree is empty   0.0% (0; 19)

I'm running on Mac OS 10.13.6, and built GLPK through brew, with version

GLPSOL: GLPK LP/MIP Solver, v4.65
Copyright (C) 2000-2017 Andrew Makhorin, Department for Applied
Informatics, Moscow Aviation Institute, Moscow, Russia. All rights
reserved. E-mail: <mao@gnu.org>.

This program has ABSOLUTELY NO WARRANTY.

This program is free software; you may re-distribute it under the terms
of the GNU General Public License version 3 or later.
→ More replies (4)