From: Ben Harris Date: Mon, 27 May 2024 13:16:38 +0000 (+0100) Subject: 19a: correct maximum-cost calculation X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=402d7f44ac41ceba020c87525846e1df8b7c5a7d;p=aoc-2022.git 19a: correct maximum-cost calculation --- diff --git a/19/19a.bqn b/19/19a.bqn index 28be0de..04653f6 100644 --- a/19/19a.bqn +++ b/19/19a.bqn @@ -20,7 +20,8 @@ Prep←{ NtZ←{=˜𝕩 ? 𝕩; 0}¨ # NaN is not equal to itself. EvalBlueprint←{𝕊 robot_costs: - max_costs←⌈´˘robot_costs + •Show robot_costs + •Show max_costs←⌈˝(robot_costs∾[⟨0,0,0,∞⟩]) # Want all the geodes. Search←{ 𝕊⟨time,stock,robots⟩: #•Show ⟨time,stock,robots⟩ result←⌈´{ @@ -37,7 +38,6 @@ EvalBlueprint←{𝕊 robot_costs: 𝕊⟨time,stock,robots⟩: 3⊑stock+robots×time # If not, return number of geodes we can get in time. } - •Show robot_costs •Show Search ⟨24,⟨0,0,0,0⟩,⟨1,0,0,0⟩⟩ }