diff options
| author | Orfeas <38209077+0xfea5@users.noreply.github.com> | 2025-12-04 02:17:48 +0200 |
|---|---|---|
| committer | Orfeas <38209077+0xfea5@users.noreply.github.com> | 2025-12-04 03:59:48 +0200 |
| commit | 99bfa2520fb9b7215cd1aba92fc48fa6cfed3b92 (patch) | |
| tree | c3469f2d529617667b53536aff4d0973acd75193 /day01 | |
| parent | day01 (diff) | |
| download | aoc25-99bfa2520fb9b7215cd1aba92fc48fa6cfed3b92.tar.gz aoc25-99bfa2520fb9b7215cd1aba92fc48fa6cfed3b92.zip | |
.editorconfig: increase indentation
Diffstat (limited to 'day01')
| -rw-r--r-- | day01/solution.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/day01/solution.cpp b/day01/solution.cpp index 9fb9ec1..33b7550 100644 --- a/day01/solution.cpp +++ b/day01/solution.cpp | |||
| @@ -13,9 +13,7 @@ auto parse_input(std::istream& is) { | |||
| 13 | std::vector<int> document; | 13 | std::vector<int> document; |
| 14 | for (auto const line : lines) { | 14 | for (auto const line : lines) { |
| 15 | char direction = line[0]; | 15 | char direction = line[0]; |
| 16 | std::string out; | 16 | int length = std::stoi(std::ranges::to<std::string>(line | views::drop(1))); |
| 17 | ranges::copy(line | views::drop(1), std::back_inserter(out)); | ||
| 18 | int length = std::stoi(out); | ||
| 19 | document.push_back(direction == 'R' ? length : -length); | 17 | document.push_back(direction == 'R' ? length : -length); |
| 20 | } | 18 | } |
| 21 | return document; | 19 | return document; |
| @@ -54,7 +52,6 @@ void part2(auto const& input) { | |||
| 54 | } | 52 | } |
| 55 | dial %= DIAL_MAX; | 53 | dial %= DIAL_MAX; |
| 56 | old_dial = dial; | 54 | old_dial = dial; |
| 57 | std::cerr << answer << ' ' << dial << '\n'; | ||
| 58 | } | 55 | } |
| 59 | std::println("{}", answer); | 56 | std::println("{}", answer); |
| 60 | } | 57 | } |
