51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
}
printf("The sum of all 2000th secrets is {%llu}.\n", sum2000);
int c[4];
int maxbananas = 0, totalbananas = 0;
for (c[0] = -9; c[0] < 10; c[0]++) {
for (c[1] = -9; c[1] < 10; c[1]++) {
for (c[2] = -9; c[2] < 10; c[2]++) {
for (c[3] = -9; c[3] < 10; c[3]++) {
totalbananas = 0;
for (size_t s = 0; s < nsecrets; s++) {
int bananas = 0;
unsigned long long sec[2] = {0, secrets[s]};
int delta[4];
//round0
nextsecret(sec);
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
}
printf("The sum of all 2000th secrets is {%llu}.\n", sum2000);
int c[4];
int maxbananas = 0, totalbananas = 0;
for (c[0] = -9; c[0] < 10; c[0]++) {
for (c[1] = -9; c[1] < 10; c[1]++) {
int c0c1 = c[0] + c[1];
if (c0c1 < -9) continue;
if (c0c1 > 9) continue;
for (c[2] = -9; c[2] < 10; c[2]++) {
int c1c2 = c[1] + c[2];
int c0c1c2 = c[0] + c1c2;
if (c1c2 < -9) continue;
if (c1c2 > 9) continue;
if (c0c1c2 < -9) continue;
if (c0c1c2 > 9) continue;
for (c[3] = -9; c[3] < 10; c[3]++) {
int c2c3 = c[2] + c[3];
int c1c2c3 = c1c2 + c[3];
int c0c1c2c3 = c0c1 + c2c3;
if (c2c3 < -9) continue;
if (c2c3 > 9) continue;
if (c1c2c3 < -9) continue;
if (c1c2c3 > 9) continue;
if (c0c1c2c3 < -9) continue;
if (c0c1c2c3 > 9) continue;
totalbananas = 0;
for (size_t s = 0; s < nsecrets; s++) {
int bananas = 0;
unsigned long long sec[2] = {0, secrets[s]};
int delta[4];
//round0
nextsecret(sec);
|