Advent of Code

You! (AoC++) 48*

      /*2026*/

--- Day 25: The Multiverse Machine ---

"This is incredible!" exclaims an elf physicist, showing you an ancient device recovered from deep within the North Pole ice. "We've discovered what appears to be a quantum computer from a long-lost civilization!"

"We need your help," the elf continues. "We're trying to transport quantum particles through these parallel universes, but these universes behave strangely - they expand and contract as we move between them!"

The rules of quantum transport are very strict:

The elves need to transport a quantum particle from the starting position (0, 0) to a specific target location using the minimum energy.

Example:

2 7,8
4 5
6 8
9 3

In this example:

For Universe 1:

For Universe 2:

For Universe 3:

Universes 1 and 2 will align at 12 steps.
Universes 2 and 3 will align at 18 steps.
Universes 1 and 3 will align at 36 steps.

All three universes will align at 36 steps.

Your starting point is (0, 0) in Universe 1.

Following these rules:

Your final energy usage will be 5 + 7 + 10 + 7 = 29

Remember, when jumping between universes:

The elves are waiting anxiously. Can you help them optimize their quantum particle transport system while managing these expanding and contracting universes?

To begin, get your puzzle input.

Answer:

You can also this puzzle.