Overview
Comment: | 202405 2nd star |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
149ea784019c8dd3092e699a93145b56 |
User & Date: | nnz on 2024-12-05 16:55:13 |
Original Comment: | 202405 -- 2 stars |
Other Links: | manifest | tags |
Context
2024-12-05
| ||
20:38 | prepare for tomorrow, start work on 201504 check-in: d415c28af8 user: nnz tags: trunk | |
16:55 | 202405 2nd star check-in: 149ea78401 user: nnz tags: trunk | |
14:39 | 202405 -- new idea: count pages positions check-in: fccbd87615 user: nnz tags: trunk | |
Changes
Modified aoc2024.c from [355da142b3] to [72b0bedd28].
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | + + + + + + + + + - + - - - + + + + + + + + - - - - - - - - | #include <ctype.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "aocdailies.h" #include "aocutils.h" static int ppcmp(unsigned a, unsigned b, unsigned (*r)[2], size_t nr) { for (size_t k = 0; k < nr; k++) { if ((a == r[k][0]) && (b == r[k][1])) return -1; if ((a == r[k][1]) && (b == r[k][0])) return 1; } return 0; } // can't be bothered to do anything other than bubble sort static void reorder(unsigned *a, size_t na, unsigned (*r)[2], size_t nr) { |
︙ | |||
64 65 66 67 68 69 70 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | - - + + | reorder(update, nupdates, pagepair, npp); accumsum2 += update[nupdates / 2]; break; } } accumsum += accum; } while ((line = strtok(NULL, "\n")) != NULL); |
︙ |