aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/2016/day5/aoc.cpp4
-rw-r--r--src/2020/day5/aoc.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/2016/day5/aoc.cpp b/src/2016/day5/aoc.cpp
index 16c5f70..024a9ff 100644
--- a/src/2016/day5/aoc.cpp
+++ b/src/2016/day5/aoc.cpp
@@ -12,10 +12,10 @@ void day5(const char* secret, int len, char pass1[], char pass2[]) {
int x1 = len;
int x2 = 0;
while (i < INT64_MAX && x2 < 8) {
- sprintf(buf + l, "%zu", i);
+ sprintf(buf + l, "%lld", i);
char* hash = md5sum(buf);
if (lead_zeros(hash) >= 5) {
- printf("%zu %s\n", i, hash);
+ printf("%lld %s\n", i, hash);
if (x1 > 0) {
pass1[len - x1] = hash[5];
x1--;
diff --git a/src/2020/day5/aoc.h b/src/2020/day5/aoc.h
index 9e7ea4f..d434790 100644
--- a/src/2020/day5/aoc.h
+++ b/src/2020/day5/aoc.h
@@ -14,7 +14,7 @@ struct seat {
int col;
int id() const noexcept { return row * 8 + col; }
- bool operator<(const seat& other) { return id() < other.id(); }
+ bool operator<(const seat& other) const noexcept { return id() < other.id(); }
seat(int r, int c) : row(r), col(c) {}