diff options
author | kaiwu <kaiwu2004@gmail.com> | 2022-12-19 22:34:13 +0800 |
---|---|---|
committer | kaiwu <kaiwu2004@gmail.com> | 2022-12-19 22:34:13 +0800 |
commit | 0cfd07586a4044dafb3614dfe8d966478abada34 (patch) | |
tree | 7501fe58b53dca0436687129cf30558952f503ce /src | |
parent | 6457077628912b5da2d32343664166230321dc28 (diff) | |
download | advent-of-code-0cfd07586a4044dafb3614dfe8d966478abada34.tar.gz advent-of-code-0cfd07586a4044dafb3614dfe8d966478abada34.zip |
2022 day15
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; } |