From 48c96ce7ea2dfb2221a08792bf02439e4f545ec3 Mon Sep 17 00:00:00 2001 From: Keenan Tims Date: Wed, 11 Dec 2024 09:54:10 -0800 Subject: [PATCH] day24: cheat solution used for part 2 submission --- 24/cheat.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 24/cheat.py diff --git a/24/cheat.py b/24/cheat.py new file mode 100644 index 0000000..b2d3d4a --- /dev/null +++ b/24/cheat.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +from z3 import * + +rx, ry, rz = Ints('rx ry rz') +rvx, rvy, rvz = Ints('rvx rvy rvz') +t0, t1, t2 = Ints('t0 t1 t2') +answer = Int('answer') + +solve( + rx + t0 * rvx == 225415405941969 + t0 * 23, + ry + t0 * rvy == 400648127977931 + t0 * -204, + rz + t0 * rvz == 79201130433258 + t0 * 617, + + rx + t1 * rvx == 353783687623292 + t1 * -80, + ry + t1 * rvy == 138575899489956 + t1 * 156, + rz + t1 * rvz == 318416438572569 + t1 * 21, + + rx + t2 * rvx == 215751176267772 + t2 * -120, + ry + t2 * rvy == 376619563956940 + t2 * 126, + rz + t2 * rvz == 230133299986253 + t2 * -352, + + answer == rx + ry + rz, +)