{"id":18829452,"url":"https://github.com/michaeladler/aoc-2023","last_synced_at":"2025-04-11T12:22:13.399Z","repository":{"id":211061289,"uuid":"725650714","full_name":"michaeladler/aoc-2023","owner":"michaeladler","description":"AoC 2023 solutions in C","archived":false,"fork":false,"pushed_at":"2024-12-11T10:50:01.000Z","size":525,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T08:42:33.248Z","etag":null,"topics":["advent-of-code","advent-of-code-2023","adventofcode-in-c","aoc","aoc2023","aoc2023-in-c","c"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaeladler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-11-30T15:34:24.000Z","updated_at":"2024-12-11T10:50:05.000Z","dependencies_parsed_at":"2023-12-14T17:48:36.137Z","dependency_job_id":"5d9d3e9b-4542-46b5-9e5a-7b6537dbe97a","html_url":"https://github.com/michaeladler/aoc-2023","commit_stats":null,"previous_names":["michaeladler/aoc-2023"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeladler%2Faoc-2023","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeladler%2Faoc-2023/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeladler%2Faoc-2023/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeladler%2Faoc-2023/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaeladler","download_url":"https://codeload.github.com/michaeladler/aoc-2023/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401165,"owners_count":21097325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advent-of-code","advent-of-code-2023","adventofcode-in-c","aoc","aoc2023","aoc2023-in-c","c"],"created_at":"2024-11-08T01:44:50.979Z","updated_at":"2025-04-11T12:22:13.362Z","avatar_url":"https://github.com/michaeladler.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![ci](https://github.com/michaeladler/aoc-2023/actions/workflows/ci.yml/badge.svg)](https://github.com/michaeladler/aoc-2023/actions/workflows/ci.yml)\n![](https://img.shields.io/badge/stars%20⭐-40-yellow)\n\n# 🎄 Advent of Code 2023 Solutions 🎄\n\nWelcome to my repository where I share my solutions to the [Advent of Code 2023](https://adventofcode.com/2023) challenges, tackled using the **good old C programming language**.\nAdvent of Code is an annual December event where programmers solve fun, holiday-themed puzzles.\n\n## 🛠 Usage\n\nEach puzzle solution is compiled into its own standalone executable, named in accordance with its corresponding day.\nFor instance, the executable for the first puzzle is `day01`.\nBy default, these executables search for their respective input files located at `input/dayXX.txt`, where `XX` represents the two-digit day number (e.g., `01` for Day 1).\nAlternatively, you have the option to provide input via a command-line argument.\nFor example, you can run `./day01 mine.txt` to specify a different input file.\n\n## 🏗 Building and Running Tests\n\nEach puzzle in this repository is accompanied by tests, which are designed using both the examples provided in the puzzle and the actual `input.txt` file.\nSince sharing the puzzle input data is discouraged, the inputs have been encrypted.\n\n**Note**: Tests using the actual `input.txt` have to be enabled at compile time with the `-Dhave-inputs=true` option (this only make sense if you have my `input.txt` files since your answers will differ from mine).\n\n### Release Build\n\n```bash\nmeson setup --buildtype=release -Db_lto=true -Dhave-inputs=true build\nninja -C build test\n```\n\n### Debug Build\n\n```bash\nmeson setup --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dhave-inputs=true build_debug\nninja -C build_debug test\n```\n\n## ⏱ Performance Benchmarks\n\nThe solutions were tested on different processors using [hyperfine](https://github.com/sharkdp/hyperfine) and/or [poop](https://github.com/andrewrk/poop).\nCompiled using clang 16 and LTO.\n\n\n| Day | Intel i7-11850H | AMD Ryzen 5 PRO 4650U |\n| --- | --------------- | --------------------- |\n| 1   | 276 µs          | 520 µs                |\n| 2   | 185 µs          | 434 µs                |\n| 3   | 231 µs          | 501 µs                |\n| 4   | 368 µs          | 679 µs                |\n| 5   | 1.4 s           | 2.6 s                 |\n| 6   | 200 µs          | 472 µs                |\n| 7   | 2.6 ms          | 3.54 ms               |\n| 8   | 462.4 µs        | 1 ms                  |\n| 9   | 256 µs          | 464 µs                |\n| 10  | 5.8 ms          | 16.4 ms               |\n| 11  | 980 µs          | 1.7 ms                |\n| 12  | 347 ms          | 554 ms                |\n| 13  | 248 µs          | 486 µs                |\n| 14  | 44 ms           | 53.4 ms               |\n| 15  | 1.1 ms          | 1 ms                  |\n| 16  | 34.4 ms         | 33.5 ms               |\n| 17  | 315.3 ms        | 604 ms                |\n| 18  | 173 µs          | 379 µs                |\n| 19  | 422 µs          | 891 µs                |\n| 19  | 16.8 ms         |                       |\n\n## 🙏 Acknowledgments and Resources\n\nSpecial thanks to the authors of these very useful C resources:\n\n- [Cauldron](https://github.com/camel-cdr/cauldron) - A collection of useful C code snippets and utilities.\n- [C Algorithms](https://github.com/fragglet/c-algorithms) - A library of common data structures and algorithms written in C.\n- [CTL](https://github.com/glouw/ctl/) - A library for container types for C.\n- [CTest](https://github.com/bvdberg/ctest) - A unit testing framework for C.\n- [Log.c](https://github.com/rxi/log.c) - A simple logging library implemented in C.\n- [Sort](https://github.com/swenson/sort/) - A collection of sorting algorithms implemented in C.\n- [str](https://github.com/maxim2266/str) - yet another string library for C language.\n- [xxhash](https://github.com/Cyan4973/xxHash) - Extremely fast non-cryptographic hash algorithm.\n- [slice99](https://github.com/Hirrolot/slice99) -  Memory slices for C99.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeladler%2Faoc-2023","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaeladler%2Faoc-2023","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeladler%2Faoc-2023/lists"}