1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <ctype.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "aocdailies.h"
#include "aocutils.h"
/* === aoc202422 =======================================================
===================================================================== */
static long long unsigned mix(long long unsigned a, long long unsigned b) {
long long unsigned tmp = a ^ b;
return tmp;
}
static long long unsigned prune(long long unsigned a) {
|
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include <ctype.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "aocdailies.h"
#include "aocutils.h"
/* === aoc202422 =======================================================
TODO: Part Two
===================================================================== */
static long long unsigned mix(long long unsigned a, long long unsigned b) {
long long unsigned tmp = a ^ b;
return tmp;
}
static long long unsigned prune(long long unsigned a) {
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
sum2000 += secret;
key = strtok(NULL, "\n");
}
printf("The sum of all 2000th secrets is {%llu}.\n", sum2000);
}
/* === aoc202417 =======================================================
===================================================================== */
static unsigned combo(unsigned operand, unsigned long long r[3]) {
switch (operand) {
default: fprintf(stderr, "Nope!\n"); exit(EXIT_FAILURE);
case 0: return 0;
case 1: return 1;
|
>
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
sum2000 += secret;
key = strtok(NULL, "\n");
}
printf("The sum of all 2000th secrets is {%llu}.\n", sum2000);
}
/* === aoc202417 =======================================================
TODO: proper (recursive) solution for Part Two
===================================================================== */
static unsigned combo(unsigned operand, unsigned long long r[3]) {
switch (operand) {
default: fprintf(stderr, "Nope!\n"); exit(EXIT_FAILURE);
case 0: return 0;
case 1: return 1;
|