Cc618 / Advent-Of-Code-2020

Advent of code 2020 with lots of languages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advent Of Code 2020

Welcome to the Advent Of Code 2020 !

Languages

Mutiple languages have been used :

  • C
  • C++
  • C#
  • Dart
  • Go
  • Java
  • Javascript
  • Julia
  • NASM
  • Python

Problems

Some problems have multiple implementations. The time complexity for part 2 is displayed (N = length of the input).

Day Time Complexity Language
01 O(N ^ 2) Julia / C++
02 O(N) Julia
03 O(N) Dart
04 O(N) C
05 O(N) NASM / C
06 O(N) Python
07 O(N log N) Julia
08 O(N ^ 2) Javascript
09 O(N) C#
10 O(N) Go / Python
11 O(N ^ 2) Java
12 O(N) Julia
13 O(N) C++ (WIP)
14 O(N) Python
15 O(1) C++
16 O(N ^ 2) Julia
17 O(N ^ 2) C++
18 O(N) Julia
19 O(N) Python
20 O(N ^ 2) Julia (WIP)
22 O(N) C++

How to run ?

The input is always passed via stdin by piping.

Compiled languages

For instance, compiled languages like C++ first compile the code :

g++ -o program 1.cpp

Note that some files contain specific instructions to compile (to build C with NASM for instance).

And then execute it :

cat 1.input | ./program

Interpreted languages

Interpreted / JIT compiled languages such as Julia need only one command :

cat 1.input | julia 1.jl

Notes

All problems have been made on x86_64 Arch Linux.

C#

Compiled with Mono on Linux.

Javascript

Javascript is executed via NodeJS.

NASM

NASM files target x86_64 linux machines.

Python

Python version is 3.9+.

About

Advent of code 2020 with lots of languages

License:MIT License


Languages

Language:Julia 27.1%Language:C++ 18.2%Language:C 13.6%Language:Python 12.0%Language:Java 10.7%Language:Assembly 4.5%Language:JavaScript 4.0%Language:C# 3.9%Language:Go 3.7%Language:Dart 2.1%