Skip to content

raulloiscuns/advent-of-code-2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2024 🎅

This repository contains my solutions to the AOC 2024 puzzles. This year, I decided to implement my solutions in C++ to practice and learn the language, focusing specifically on becoming familiar with the C++20 standard.

Usage

Each day's solution and its corresponding test input files are located in a subdirectory named day_NN, where NN represents the day number.

To compile the solutions use:

g++ -std=c++20 -o main main.cpp

to run the code use:

./main i input.txt

where i is the number part (1 or 2) and input the input file. Puzzle solution's is printed in stdout.

Puzzle statements

The puzzle instructions can be found here. A brief summary of each of the statements of each problem is shown below.

  1. Historian Hysteria

Day 01: Historian Hysteria

The input are two list of integers (location IDs).

  • Part 1: Compute the total distance between the two lists, defined as the sum of the distances between the paired numbers in increasing order.
  • Part 2: Compute the total similarity score by adding up each number in the left list after multiplying it by the number of times that number appears in the right list.

About

My solutions for the Advent of Code 2024 puzzles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages