aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkaiwu <kaiwu2004@gmail.com>2022-04-03 16:56:31 +0800
committerkaiwu <kaiwu2004@gmail.com>2022-04-03 16:56:31 +0800
commite8daf4c16f0616868f6c719e52f054dc19692d3e (patch)
tree6e85fcb42f5f972a88f2540c0dea640222a9a2df /src
parent1e7f58a8c34b916b1bb7cc1155cd25db8801e284 (diff)
downloadadvent-of-code-e8daf4c16f0616868f6c719e52f054dc19692d3e.tar.gz
advent-of-code-e8daf4c16f0616868f6c719e52f054dc19692d3e.zip
day1s
Diffstat (limited to 'src')
-rw-r--r--src/2017/day1/README.md1
-rw-r--r--src/2017/day1/aoc.cpp3
-rw-r--r--src/2017/day1/aoc.h6
-rw-r--r--src/2017/day1/input1
-rw-r--r--src/2018/day1/README.md1
-rw-r--r--src/2018/day1/aoc.cpp3
-rw-r--r--src/2018/day1/aoc.h6
-rw-r--r--src/2018/day1/input1
-rw-r--r--src/2019/day1/README.md21
-rw-r--r--src/2019/day1/aoc.cpp3
-rw-r--r--src/2019/day1/aoc.h6
-rw-r--r--src/2019/day1/input1
-rw-r--r--src/2020/day1/README.md21
-rw-r--r--src/2020/day1/aoc.cpp3
-rw-r--r--src/2020/day1/aoc.h6
-rw-r--r--src/2020/day1/input1
-rw-r--r--src/2021/day1/README.md21
-rw-r--r--src/2021/day1/aoc.cpp3
-rw-r--r--src/2021/day1/aoc.h6
-rw-r--r--src/2021/day1/input1
-rw-r--r--src/CMakeLists.txt5
21 files changed, 120 insertions, 0 deletions
diff --git a/src/2017/day1/README.md b/src/2017/day1/README.md
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/src/2017/day1/README.md
@@ -0,0 +1 @@
+
diff --git a/src/2017/day1/aoc.cpp b/src/2017/day1/aoc.cpp
new file mode 100644
index 0000000..9381e0c
--- /dev/null
+++ b/src/2017/day1/aoc.cpp
@@ -0,0 +1,3 @@
+#include "aoc.h"
+
+namespace aoc2017 {}
diff --git a/src/2017/day1/aoc.h b/src/2017/day1/aoc.h
new file mode 100644
index 0000000..7aacc4c
--- /dev/null
+++ b/src/2017/day1/aoc.h
@@ -0,0 +1,6 @@
+#pragma once
+#include "common.h"
+
+namespace aoc2017 {
+
+}
diff --git a/src/2017/day1/input b/src/2017/day1/input
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/src/2017/day1/input
@@ -0,0 +1 @@
+
diff --git a/src/2018/day1/README.md b/src/2018/day1/README.md
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/src/2018/day1/README.md
@@ -0,0 +1 @@
+
diff --git a/src/2018/day1/aoc.cpp b/src/2018/day1/aoc.cpp
new file mode 100644
index 0000000..1d092ff
--- /dev/null
+++ b/src/2018/day1/aoc.cpp
@@ -0,0 +1,3 @@
+#include "aoc.h"
+
+namespace aoc2018 {}
diff --git a/src/2018/day1/aoc.h b/src/2018/day1/aoc.h
new file mode 100644
index 0000000..4bfdbf3
--- /dev/null
+++ b/src/2018/day1/aoc.h
@@ -0,0 +1,6 @@
+#pragma once
+#include "common.h"
+
+namespace aoc2018 {
+
+}
diff --git a/src/2018/day1/input b/src/2018/day1/input
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/src/2018/day1/input
@@ -0,0 +1 @@
+
diff --git a/src/2019/day1/README.md b/src/2019/day1/README.md
new file mode 100644
index 0000000..64299f9
--- /dev/null
+++ b/src/2019/day1/README.md
@@ -0,0 +1,21 @@
+--- Day 1: No Time for a Taxicab ---
+
+Santa's sleigh uses a very high-precision clock to guide its movements, and the clock's oscillator is regulated by stars. Unfortunately, the stars have been stolen... by the Easter Bunny. To save Christmas, Santa needs you to retrieve all fifty stars by December 25th.
+
+Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!
+
+You're airdropped near Easter Bunny Headquarters in a city somewhere. "Near", unfortunately, is as close as you can get - the instructions on the Easter Bunny Recruiting Document the Elves intercepted start here, and nobody had time to work them out further.
+
+The Document indicates that you should start at the given coordinates (where you just landed) and face North. Then, follow the provided sequence: either turn left (L) or right (R) 90 degrees, then walk forward the given number of blocks, ending at a new intersection.
+
+There's no time to follow such ridiculous instructions on foot, though, so you take a moment and work out the destination. Given that you can only walk on the street grid of the city, how far is the shortest path to the destination?
+
+For example:
+
+ Following R2, L3 leaves you 2 blocks East and 3 blocks North, or 5 blocks away.
+ R2, R2, R2 leaves you 2 blocks due South of your starting position, which is 2 blocks away.
+ R5, L5, R5, R3 leaves you 12 blocks away.
+
+How many blocks away is Easter Bunny HQ?
+
+
diff --git a/src/2019/day1/aoc.cpp b/src/2019/day1/aoc.cpp
new file mode 100644
index 0000000..26fed89
--- /dev/null
+++ b/src/2019/day1/aoc.cpp
@@ -0,0 +1,3 @@
+#include "aoc.h"
+
+namespace aoc2019 {}
diff --git a/src/2019/day1/aoc.h b/src/2019/day1/aoc.h
new file mode 100644
index 0000000..95823fe
--- /dev/null
+++ b/src/2019/day1/aoc.h
@@ -0,0 +1,6 @@
+#pragma once
+#include "common.h"
+
+namespace aoc2016 {
+
+}
diff --git a/src/2019/day1/input b/src/2019/day1/input
new file mode 100644
index 0000000..22adf2a
--- /dev/null
+++ b/src/2019/day1/input
@@ -0,0 +1 @@
+R1, L3, R5, R5, R5, L4, R5, R1, R2, L1, L1, R5, R1, L3, L5, L2, R4, L1, R4, R5, L3, R5, L1, R3, L5, R1, L2, R1, L5, L1, R1, R4, R1, L1, L3, R3, R5, L3, R4, L4, R5, L5, L1, L2, R4, R3, R3, L185, R3, R4, L5, L4, R48, R1, R2, L1, R1, L4, L4, R77, R5, L2, R192, R2, R5, L4, L5, L3, R2, L4, R1, L5, R5, R4, R1, R2, L3, R4, R4, L2, L4, L3, R5, R4, L2, L1, L3, R1, R5, R5, R2, L5, L2, L3, L4, R2, R1, L4, L1, R1, R5, R3, R3, R4, L1, L4, R1, L2, R3, L3, L2, L1, L2, L2, L1, L2, R3, R1, L4, R1, L1, L4, R1, L2, L5, R3, L5, L2, L2, L3, R1, L4, R1, R1, R2, L1, L4, L4, R2, R2, R2, R2, R5, R1, L1, L4, L5, R2, R4, L3, L5, R2, R3, L4, L1, R2, R3, R5, L2, L3, R3, R1, R3
diff --git a/src/2020/day1/README.md b/src/2020/day1/README.md
new file mode 100644
index 0000000..64299f9
--- /dev/null
+++ b/src/2020/day1/README.md
@@ -0,0 +1,21 @@
+--- Day 1: No Time for a Taxicab ---
+
+Santa's sleigh uses a very high-precision clock to guide its movements, and the clock's oscillator is regulated by stars. Unfortunately, the stars have been stolen... by the Easter Bunny. To save Christmas, Santa needs you to retrieve all fifty stars by December 25th.
+
+Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!
+
+You're airdropped near Easter Bunny Headquarters in a city somewhere. "Near", unfortunately, is as close as you can get - the instructions on the Easter Bunny Recruiting Document the Elves intercepted start here, and nobody had time to work them out further.
+
+The Document indicates that you should start at the given coordinates (where you just landed) and face North. Then, follow the provided sequence: either turn left (L) or right (R) 90 degrees, then walk forward the given number of blocks, ending at a new intersection.
+
+There's no time to follow such ridiculous instructions on foot, though, so you take a moment and work out the destination. Given that you can only walk on the street grid of the city, how far is the shortest path to the destination?
+
+For example:
+
+ Following R2, L3 leaves you 2 blocks East and 3 blocks North, or 5 blocks away.
+ R2, R2, R2 leaves you 2 blocks due South of your starting position, which is 2 blocks away.
+ R5, L5, R5, R3 leaves you 12 blocks away.
+
+How many blocks away is Easter Bunny HQ?
+
+
diff --git a/src/2020/day1/aoc.cpp b/src/2020/day1/aoc.cpp
new file mode 100644
index 0000000..a57fb7c
--- /dev/null
+++ b/src/2020/day1/aoc.cpp
@@ -0,0 +1,3 @@
+#include "aoc.h"
+
+namespace aoc2020 {}
diff --git a/src/2020/day1/aoc.h b/src/2020/day1/aoc.h
new file mode 100644
index 0000000..c5ad3d1
--- /dev/null
+++ b/src/2020/day1/aoc.h
@@ -0,0 +1,6 @@
+#pragma once
+#include "common.h"
+
+namespace aoc2020 {
+
+}
diff --git a/src/2020/day1/input b/src/2020/day1/input
new file mode 100644
index 0000000..22adf2a
--- /dev/null
+++ b/src/2020/day1/input
@@ -0,0 +1 @@
+R1, L3, R5, R5, R5, L4, R5, R1, R2, L1, L1, R5, R1, L3, L5, L2, R4, L1, R4, R5, L3, R5, L1, R3, L5, R1, L2, R1, L5, L1, R1, R4, R1, L1, L3, R3, R5, L3, R4, L4, R5, L5, L1, L2, R4, R3, R3, L185, R3, R4, L5, L4, R48, R1, R2, L1, R1, L4, L4, R77, R5, L2, R192, R2, R5, L4, L5, L3, R2, L4, R1, L5, R5, R4, R1, R2, L3, R4, R4, L2, L4, L3, R5, R4, L2, L1, L3, R1, R5, R5, R2, L5, L2, L3, L4, R2, R1, L4, L1, R1, R5, R3, R3, R4, L1, L4, R1, L2, R3, L3, L2, L1, L2, L2, L1, L2, R3, R1, L4, R1, L1, L4, R1, L2, L5, R3, L5, L2, L2, L3, R1, L4, R1, R1, R2, L1, L4, L4, R2, R2, R2, R2, R5, R1, L1, L4, L5, R2, R4, L3, L5, R2, R3, L4, L1, R2, R3, R5, L2, L3, R3, R1, R3
diff --git a/src/2021/day1/README.md b/src/2021/day1/README.md
new file mode 100644
index 0000000..64299f9
--- /dev/null
+++ b/src/2021/day1/README.md
@@ -0,0 +1,21 @@
+--- Day 1: No Time for a Taxicab ---
+
+Santa's sleigh uses a very high-precision clock to guide its movements, and the clock's oscillator is regulated by stars. Unfortunately, the stars have been stolen... by the Easter Bunny. To save Christmas, Santa needs you to retrieve all fifty stars by December 25th.
+
+Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!
+
+You're airdropped near Easter Bunny Headquarters in a city somewhere. "Near", unfortunately, is as close as you can get - the instructions on the Easter Bunny Recruiting Document the Elves intercepted start here, and nobody had time to work them out further.
+
+The Document indicates that you should start at the given coordinates (where you just landed) and face North. Then, follow the provided sequence: either turn left (L) or right (R) 90 degrees, then walk forward the given number of blocks, ending at a new intersection.
+
+There's no time to follow such ridiculous instructions on foot, though, so you take a moment and work out the destination. Given that you can only walk on the street grid of the city, how far is the shortest path to the destination?
+
+For example:
+
+ Following R2, L3 leaves you 2 blocks East and 3 blocks North, or 5 blocks away.
+ R2, R2, R2 leaves you 2 blocks due South of your starting position, which is 2 blocks away.
+ R5, L5, R5, R3 leaves you 12 blocks away.
+
+How many blocks away is Easter Bunny HQ?
+
+
diff --git a/src/2021/day1/aoc.cpp b/src/2021/day1/aoc.cpp
new file mode 100644
index 0000000..5f8b1ce
--- /dev/null
+++ b/src/2021/day1/aoc.cpp
@@ -0,0 +1,3 @@
+#include "aoc.h"
+
+namespace aoc2021 {}
diff --git a/src/2021/day1/aoc.h b/src/2021/day1/aoc.h
new file mode 100644
index 0000000..cd205cd
--- /dev/null
+++ b/src/2021/day1/aoc.h
@@ -0,0 +1,6 @@
+#pragma once
+#include "common.h"
+
+namespace aoc2021 {
+
+}
diff --git a/src/2021/day1/input b/src/2021/day1/input
new file mode 100644
index 0000000..22adf2a
--- /dev/null
+++ b/src/2021/day1/input
@@ -0,0 +1 @@
+R1, L3, R5, R5, R5, L4, R5, R1, R2, L1, L1, R5, R1, L3, L5, L2, R4, L1, R4, R5, L3, R5, L1, R3, L5, R1, L2, R1, L5, L1, R1, R4, R1, L1, L3, R3, R5, L3, R4, L4, R5, L5, L1, L2, R4, R3, R3, L185, R3, R4, L5, L4, R48, R1, R2, L1, R1, L4, L4, R77, R5, L2, R192, R2, R5, L4, L5, L3, R2, L4, R1, L5, R5, R4, R1, R2, L3, R4, R4, L2, L4, L3, R5, R4, L2, L1, L3, R1, R5, R5, R2, L5, L2, L3, L4, R2, R1, L4, L1, R1, R5, R3, R3, R4, L1, L4, R1, L2, R3, L3, L2, L1, L2, L2, L1, L2, R3, R1, L4, R1, L1, L4, R1, L2, L5, R3, L5, L2, L2, L3, R1, L4, R1, R1, R2, L1, L4, L4, R2, R2, R2, R2, R5, R1, L1, L4, L5, R2, R4, L3, L5, R2, R3, L4, L1, R2, R3, R5, L2, L3, R3, R1, R3
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1603ee8..1ef32e0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -24,6 +24,11 @@ set(SOLUTION_FILES
"2015/day22/aoc.cpp"
"2016/day1/aoc.cpp"
+ "2017/day1/aoc.cpp"
+ "2018/day1/aoc.cpp"
+ "2019/day1/aoc.cpp"
+ "2020/day1/aoc.cpp"
+ "2021/day1/aoc.cpp"
)
add_library(solution SHARED ${SOLUTION_FILES})