aboutsummaryrefslogtreecommitdiff
path: root/src/2022/day13/aoc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/2022/day13/aoc.cpp')
-rw-r--r--src/2022/day13/aoc.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/2022/day13/aoc.cpp b/src/2022/day13/aoc.cpp
index f844116..070f0cd 100644
--- a/src/2022/day13/aoc.cpp
+++ b/src/2022/day13/aoc.cpp
@@ -14,14 +14,14 @@ std::pair<int, int> find(const std::vector<pkt>& ps) {
size_t s2 = ps.size() - 2;
size_t a{0}, b{0};
for(size_t i = 0; i < ps.size(); i++) {
- if (ps[i].i == s1) a = i;
- if (ps[i].i == s2) b = i;
- printf("%zu :", i);
- ps[i].p->print(0);
- printf("\n");
+ if (ps[i].i == s1) a = i + 1;
+ if (ps[i].i == s2) b = i + 1;
+ // printf("%zu %zu:", i + 1, ps[i].i);
+ // ps[i].p->print(0);
+ // printf("\n");
}
- printf("%zu %zu\n", a, b);
- return {a + 1, b + 1};
+ // printf("%zu %zu\n", a, b);
+ return {a, b};
}
std::pair<int, int> day13(line_view file) {
@@ -40,7 +40,7 @@ std::pair<int, int> day13(line_view file) {
packet::load(&p, &ps[i]);
all.push_back({pkt, (size_t) pair});
if (i == 1 && *(ps[0]) < *(ps[1])) {
- printf("group[%d] is in right order\n", pair/2 + 1);
+ // printf("group[%d] is in right order\n", pair/2 + 1);
count += pair / 2 + 1;
}
pair += 1;