Skip to content

Immortale-dev/adventofcode2021

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2021

C++ solutions for AOC 2021 event

Build and Run

you can build solutions for each day using any c++ compiler version at least 14. And then just pipe your input to the input buffer.

Example:

cd d12
g++ -o ./a.exe ./a.cpp
./a.exe < input.txt

Days

  • Day 1: Simple constructive problem.
  • Day 2: Simple constructive problem. Not harder then the first one.
  • Day 3: Constructive problem + bit operations.
  • Day 4: Constructive problem could be optimized to work faster, but the input is small enough for the brute force.
  • Day 5: Constructive problem. Input size is small enough to build a grid and fill it with numbers.
  • Day 6: Simple constructive with requirement of some optimisations for the second part.
  • Day 7: First part is finding median problem, and the second one probably could be solved in some pretty way, but the input is small enough to brute force.
  • Day 8: Could be solved with brute force in just O(7! * n) but you get more fun by figuring out digit parts relations. :P
  • Day 9: Simple bfs problem.
  • Day 10: Pretty simple problem that could be solved using stacks.
  • Day 11: Constructive problem with a bit of recursion. P.S. left some comments for visualisation. ;)
  • Day 12: Simple graph problem. Solved using dfs.
  • Day 13: Simple custructive problem. P.S. better to compile with -O3 flag. :P
  • Day 14: Pretty interesting problem. First part is simple constructive, but for the second part some optimisations required (similar to day 6). :P
  • Day 15: Simple shortest path finding problem. Solved using bfs.
  • Day 16: The most beautiful constructive problem so far! It includes work for parsing bitstream, building multi level structures, and travel these structures with dfs. ^_^
  • Day 17: Pretty werid constructive problem. Could be solved in more elegant way, but input is small enough to brute force. :\
  • Day 18: Pretty interesting constructive problem. Should be solved in the same beautiful way as problem from day 16, but I was too lazy, so my solution is a bit hacky :{
  • Day 19: The hardest constructive problem so far! Needs a lot of code to be written, it's hard to debug, but I liked it! P.S. better to compile with -O3 flag, as finding solution might take some time. I've put the indicater to see the progress :D
  • Day 20: Pretty easy constructive problem. Nothing special. Be aware of the first and last bit of enhance map. ;)
  • Day 21: First part is simple constructive, but the second part is pretty nice dp problem! I've truly enjoyed it. :']
  • Day 22: Very nice axis optimization problem! Beautiful! Don't forget to compile with -O3 flag, as it takes ~10s to complete, added progress bar. :P
  • Day 23: Pretty annoying brute force problem... It looks not that hard from the first blance, but it requires a lot of coding and it's easy to screw a lot of things. Don't forget to compile with -O3 falg, so the solutions runs in 1s.
  • Day 24: Ah, classic AOC problem where you need to figure out solution by analyzing the input data. Very nice problem! P.S. I figured out it, so you can just send your data as usual. ;) And don't forget to compile with -O3. :P
  • Day 25: Some easy constructive problem in the end! :)

License

MIT

Releases

No releases published

Packages

No packages published

Languages