diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/2022/day15/aoc.cpp | 3 | ||||
-rw-r--r-- | src/2022/day15/aoc.h | 9 |
2 files changed, 0 insertions, 12 deletions
diff --git a/src/2022/day15/aoc.cpp b/src/2022/day15/aoc.cpp index b9b0e15..bf87c77 100644 --- a/src/2022/day15/aoc.cpp +++ b/src/2022/day15/aoc.cpp @@ -6,9 +6,6 @@ typedef sensor::pos pos; typedef sensor::line line; typedef std::vector<std::pair<int, std::vector<line>>> vecpair; -int sensor::minx; -int sensor::maxx; - static std::vector<line> merge(const std::vector<line>& ls) { std::vector<line> merged; if (ls.empty()) diff --git a/src/2022/day15/aoc.h b/src/2022/day15/aoc.h index e8e279e..40efaef 100644 --- a/src/2022/day15/aoc.h +++ b/src/2022/day15/aoc.h @@ -24,9 +24,6 @@ struct sensor { friend bool operator<(const line& l1, const line& l2) { return l1.p0.x < l2.p0.x; } }; - static int minx; - static int maxx; - pos ps[2] = {{0, 0}, {0, 0}}; static int mdistance(pos p1, pos p2) { return std::abs(p1.x - p2.x) + std::abs(p1.y - p2.y); } @@ -73,12 +70,6 @@ struct sensor { } p++; } - auto x1 = ps[0].x - mdistance(ps[0], ps[1]); - auto x2 = ps[0].x + mdistance(ps[0], ps[1]); - if (minx > x1) - minx = x1; - if (maxx < x2) - maxx = x2; } bool operator<(const sensor& s) const noexcept { return ps[0].x < s.ps[0].x; } |