diff options
author | kaiwu <kaiwu2004@gmail.com> | 2022-12-13 08:54:55 +0800 |
---|---|---|
committer | kaiwu <kaiwu2004@gmail.com> | 2022-12-13 08:54:55 +0800 |
commit | f4a140d4bd7d0a7c2d39c7c266bf2a596f7df49c (patch) | |
tree | e6eca8cce870817bdaf5d8f2ad6853f2dd30b8ff /src/2022/day12/aoc.cpp | |
parent | 8579b920f5ae6bd14b795b92e8864e650e82b837 (diff) | |
download | advent-of-code-f4a140d4bd7d0a7c2d39c7c266bf2a596f7df49c.tar.gz advent-of-code-f4a140d4bd7d0a7c2d39c7c266bf2a596f7df49c.zip |
2022 day12 part1
Diffstat (limited to 'src/2022/day12/aoc.cpp')
-rw-r--r-- | src/2022/day12/aoc.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/2022/day12/aoc.cpp b/src/2022/day12/aoc.cpp index c0d1db5..7b79e94 100644 --- a/src/2022/day12/aoc.cpp +++ b/src/2022/day12/aoc.cpp @@ -11,13 +11,14 @@ std::pair<int, int> day12(line_view file) { return true; }); - hm.print(); - std::vector<int> paths; - hm.was(hm.start) += 1; - hm.find(0, hm.start, paths); + // hm.print(); + std::vector<heightmap::pos> ps; + hm.find_prev(0, hm.end, ps); - std::sort(paths.begin(), paths.end()); - return {paths[0], 0}; + for (auto &p : ps) { + printf("%d %d\n", p.x, p.y); + } + return {0, 0}; } } |