Overview
Comment: | brought 202422 down to under 10 minutes |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | trunk |
Files: | files | file ages | folders |
SHA3-256: |
f0e101dfbf600a976f7b539ba9281fc3 |
User & Date: | nnz on 2025-01-12 17:28:18 |
Other Links: | manifest | tags |
Context
2025-01-12
| ||
17:28 | brought 202422 down to under 10 minutes Leaf check-in: f0e101dfbf user: nnz tags: trunk | |
15:44 | 202422 2nd star -- brute force 30 mins runtime check-in: 367ff5ba4e user: nnz tags: trunk | |
Changes
Modified aoc2024.c from [0631d1d281] to [bea59ec839].
︙ | ︙ | |||
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); |
︙ | ︙ |