Skip to content

This repository contains solutions to each of the problems in Advent of Code 2016, 2017, 2018, 2019, 2020, 2021, 2022 and 2023 in C++ (and 2020 in Python as well)

Notifications You must be signed in to change notification settings

vss2sn/advent_of_code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code

This repository contains solutions to the Advent of Code puzzles.

Current Status

Year C++ Python Link to folders Link to README.md
2024 1-18 - Link Link
2023 1-25 - Link Link
2022 1-25 - Link Link
2021 1-25 - Link Link
2020 1-25 1-25 Link Link
2019 1-25 1-7 Link Link
2018 1-25 - Link Link
2017 1-25 - Link Link
2016 1-25 - Link Link
2015 1-25 - Link Link

To run

To run any day's/puzzle's solution, use the following command:

# To compile
# <clang++/g++> <year>/cpp/day_<##><a/b>.cpp -o <output file>
# To run
# ./<output file> <path to input file>
# ./<output file> <year>/<input/sample_input>/day_<##>_<input/sample_input>

# Sample
g++ 2016/cpp/day_01a.cpp -o a.out
./a.out 2016/input/day_01_input

Some of the files might need c++20/23 support, so those will need to be compiled as follows:

g++-13 2024/cpp/day_01a.cpp -std=gnu++2b -o a.out
./a.out 2024/input/day_01_input