diff --git a/day4/p2.c b/day4/p2.c index 14378a8..dffbab8 100644 --- a/day4/p2.c +++ b/day4/p2.c @@ -23,13 +23,13 @@ int main(int argc, char **argv) { return -1; } - uint32_t total_copies = 0; + uint64_t total_copies = 0; size_t winning_numbers_len = 0; int8_t *winning_numbers = NULL; char *colon_pos = NULL, *pipe_pos = NULL; - uint32_t stack[STACK_SZ] = {0}; + uint64_t stack[STACK_SZ] = {0}; uint8_t stack_pos = 0; while (getline(&line, &line_length, input) != -1) { @@ -45,7 +45,7 @@ int main(int argc, char **argv) { winning_numbers[i] = parse_number((char *)(wl_pos-1)); } - uint32_t card_copies = 1 + stack[stack_pos++]; + uint64_t card_copies = 1 + stack[stack_pos++]; total_copies += card_copies; @@ -70,7 +70,7 @@ int main(int argc, char **argv) { free(winning_numbers); - printf("%d\n", total_copies); + printf("%lu\n", total_copies); return 0; }