aboutsummaryrefslogtreecommitdiff
path: root/2024/12/day12b.cpp
diff options
context:
space:
mode:
Diffstat (limited to '2024/12/day12b.cpp')
-rw-r--r--2024/12/day12b.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/2024/12/day12b.cpp b/2024/12/day12b.cpp
index 4078fa7..987df47 100644
--- a/2024/12/day12b.cpp
+++ b/2024/12/day12b.cpp
@@ -57,8 +57,8 @@ public:
57 { 57 {
58 for (int64_t i = 0; i < N; i++) { 58 for (int64_t i = 0; i < N; i++) {
59 for (int64_t j = 0; j < M; j++) { 59 for (int64_t j = 0; j < M; j++) {
60 region[N*i+j] = -1; 60 region[M*i+j] = -1;
61 cells[N*i+j] = lines[i][j]; 61 cells[M*i+j] = lines[i][j];
62 } 62 }
63 } 63 }
64 } 64 }
@@ -107,7 +107,7 @@ private:
107 107
108 int64_t coord(const Position p) const { 108 int64_t coord(const Position p) const {
109 auto [i, j] = p; 109 auto [i, j] = p;
110 return i >= N || i < 0 || j >= M || j < 0 ? -1 : N * i + j; 110 return i >= N || i < 0 || j >= M || j < 0 ? -1 : M * i + j;
111 } 111 }
112 112
113 bool is_visited(const Position p, const Direction d) const { 113 bool is_visited(const Position p, const Direction d) const {

Generated with cgit - Back to sebastiano.tronto.net