Advent of Code 2021 day 19
12/19/2022, 5:00 AMDavid Whittaker
12/19/2022, 5:36 AMDavid Whittaker
12/19/2022, 5:56 AMSergei Petunin
12/19/2022, 5:57 AMSergei Petunin
12/19/2022, 6:14 AMJonathan Kolberg
12/19/2022, 6:47 AMJonathan Kolberg
12/19/2022, 6:53 AMelizarov
12/19/2022, 8:03 AMJonathan Kolberg
12/19/2022, 8:16 AMelizarov
12/19/2022, 8:17 AMMarcin Wisniowski
12/19/2022, 8:20 AMMarcin Wisniowski
12/19/2022, 8:21 AMMarcin Wisniowski
12/19/2022, 8:38 AMelizarov
12/19/2022, 8:42 AMMarcin Wisniowski
12/19/2022, 8:45 AMdata class State(
val ore: Int = 0,
val clay: Int = 0,
val obsidian: Int = 0,
val geodes: Int = 0,
val oreRobots: Int = 1,
val clayRobots: Int = 0,
val obsidianRobots: Int = 0,
val geodeRobots: Int = 0
)
and a list of moves to reach that state. For each one I add all possible moves to my unvisited
list (which gets pruned).elizarov
12/19/2022, 8:46 AMJonathan Kolberg
12/19/2022, 8:47 AMelizarov
12/19/2022, 8:48 AMJonathan Kolberg
12/19/2022, 8:49 AMelizarov
12/19/2022, 8:51 AMMarcin Wisniowski
12/19/2022, 8:51 AMJonathan Kolberg
12/19/2022, 8:52 AMJonathan Kolberg
12/19/2022, 8:54 AMelizarov
12/19/2022, 8:55 AMJonathan Kolberg
12/19/2022, 8:56 AMelizarov
12/19/2022, 8:57 AMJonathan Kolberg
12/19/2022, 8:59 AMelizarov
12/19/2022, 8:59 AMMarcin Wisniowski
12/19/2022, 8:59 AMelizarov
12/19/2022, 9:00 AMMarcin Wisniowski
12/19/2022, 9:02 AMelizarov
12/19/2022, 9:02 AMMarcin Wisniowski
12/19/2022, 9:03 AMIām also trying to wrap my head onto why you should always build a geode robot if you canI canāt prove why that works but it certainly works, at least for my input.
elizarov
12/19/2022, 9:04 AMelizarov
12/19/2022, 9:07 AMelizarov
12/19/2022, 9:10 AMelizarov
12/19/2022, 9:12 AMMarcin Wisniowski
12/19/2022, 9:13 AMJonathan Kolberg
12/19/2022, 9:14 AMbabel
12/19/2022, 9:30 AMJonathan Kolberg
12/19/2022, 11:02 AMJonathan Kolberg
12/19/2022, 11:03 AMSergei Petunin
12/19/2022, 12:00 PMMarcin Wisniowski
12/19/2022, 12:17 PMSergei Petunin
12/19/2022, 12:24 PMMarcin Wisniowski
12/19/2022, 12:25 PMJonathan Kolberg
12/19/2022, 12:26 PMMarcin Wisniowski
12/19/2022, 12:26 PMJakub Gwóźdź
12/19/2022, 1:49 PMException in thread "main" java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects
damn it, part 2! šRiccardo Lippolis
12/19/2022, 2:02 PMSergei Petunin
12/19/2022, 4:58 PMphldavies
12/19/2022, 5:58 PMyear 2022 day 19 part 1
Default took 399.498751ms: 988
year 2022 day 19 part 2
Default took 171.593810ms: 8580
Quite happy with my runtime. Example input has:
year 2022 day 19 part 1
Default took 194.074800ms: 33
year 2022 day 19 part 2
Default took 308.349257ms: 3472
elizarov
12/19/2022, 6:21 PMphldavies
12/19/2022, 6:26 PMelizarov
12/19/2022, 6:32 PMphldavies
12/19/2022, 6:46 PMMutableMap<Robots, Int>
to track current min elapsed time Iāve seen the robots)phldavies
12/19/2022, 6:54 PMJonathan Kolberg
12/19/2022, 6:58 PMphldavies
12/19/2022, 7:13 PMephemient
12/19/2022, 7:44 PMephemient
12/19/2022, 7:44 PMphldavies
12/19/2022, 7:45 PMephemient
12/19/2022, 7:45 PMephemient
12/19/2022, 7:54 PMephemient
12/19/2022, 7:56 PMSergei Petunin
12/19/2022, 10:03 PMphldavies
12/19/2022, 10:08 PMMarcin Wisniowski
12/19/2022, 10:12 PMphldavies
12/19/2022, 10:36 PMephemient
12/19/2022, 11:10 PMephemient
12/19/2022, 11:13 PMtodd.ginsberg
12/20/2022, 2:24 AMJon Senchyna
12/20/2022, 11:19 PMJon Senchyna
12/20/2022, 11:20 PMJon Senchyna
12/20/2022, 11:22 PMJon Senchyna
12/20/2022, 11:23 PMJacob
12/30/2022, 4:13 PMphldavies
12/30/2022, 4:28 PM[ore, ore, clay, clay, clay, clay, clay, clay, obsidian, obsidian, obsidian, obsidian, clay, obsidian, geode, obsidian, geode, obsidian, geode, clay]
Jacob
12/30/2022, 4:29 PMphldavies
12/30/2022, 4:43 PMclay
is superfluous as my algorithm at the time only idled if there was nothing to buy (so was greedy on buying if there was still time). With a bias to idling for the remaining minutes I get the following order: ore, ore, clay, clay, clay, clay, clay, obsidian, obsidian, obsidian, obsidian, obsidian, geode, obsidian, geode, geode
ritesh
01/02/2023, 5:00 PMPart 2 - Exception in thread "main" java.lang.OutOfMemoryError: Java heap space