Skip to content

Immortale-dev/adventofcode2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2020

C++ solutions for AOC 2020 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 sum finding problem. Input pretty small, even brute force will work here.
  • Day 2: Simple constructive problem. Harder to parse then to solve :P
  • Day 3: Simple constructive problem.
  • Day 4: Simple parsing string problem. Could be much better solved using regex.
  • Day 5: Binary search constructive problem. The problem itself teach you to use BS :D
  • Day 6: Simple constructive problem.
  • Day 7: Tree traversal problem
  • Day 8: Simple constructive at first part, and brute force for second.
  • Day 9: Constructive problem.
  • Day 10: First part is simple constructive, for the second part dynamic programming problem.
  • Day 11: Constructive problem. Would be better to say cellular automata simulation game.
  • Day 12: Constructive problem.
  • Day 13: First part is simple remainders finding, and the second one is about Chinese Remainders Theorem. Pretty annoying problem...
  • Day 14: First part is simple constructive + bit masks, and the second one... I solved using recursion... Be patience, second part could take up to 10 seconds :P
  • Day 15: Interesting problem, it requires some analysing to be made, but I solved both parts with brute force :P
  • Day 16: Constructive problem at first part, and simple brute force for the second.
  • Day 17: Cellular automata simulation game. 3D for first part and 4D for the second.
  • Day 18: Pretty hard constructive problem. I believe it could easily solved by manipulating input data, but I used fair way with building operational parser for both parts that uses recursion.
  • Day 19: Looks like a simple brute force problem using recursion, but this problem requires some basic analysing to not stuck for years with brute forcing of second part.
  • Day 20: One of the most annoying problem. I spent half a day debugging it... Pretty hard problem that requires a lot of code to be written. I solved using bit masks and recursion.
  • Day 21: Not that hard how it looks like. Solved using hash tables and brute force.
  • Day 22: First part is simple constructive problem that could be solved using queues, and the second part requires some caching optimisation to speed up the solving. P.S. Better to compile with -O3, so the solution finding takes couple of seconds.
  • Day 23: Both parts are just for simple list operations. The only trick is to make a map to access list items by label in O(1). Anyway second part could take couple of seconds to complete :P
  • Day 24: First part is a problem for coordinating on hexagon grid, and the second part is cellular automata simulation game on hexagon grid, lol
  • Day 25: First part it pretty simple constructive problem! And the second part is better to see by yourself :P

License

MIT