aboutsummaryrefslogtreecommitdiff
path: root/2023/25
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-12-25 17:56:34 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2023-12-25 17:56:34 +0100
commit94d0033ed89bb5bfb6500051296892fb7cea6c29 (patch)
tree245eac2218310c958c2df2fad5109ea4f7b2a9d9 /2023/25
parent6a480c4eb9c96c82a8fd3663f0fbee4d32e56f19 (diff)
downloadaoc-94d0033ed89bb5bfb6500051296892fb7cea6c29.tar.gz
aoc-94d0033ed89bb5bfb6500051296892fb7cea6c29.zip
Small cleanup
Diffstat (limited to '2023/25')
-rw-r--r--2023/25/25a.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/2023/25/25a.c b/2023/25/25a.c
index 7626c74..1f3161c 100644
--- a/2023/25/25a.c
+++ b/2023/25/25a.c
@@ -1,18 +1,11 @@
1#include <inttypes.h>
2#include <stdbool.h> 1#include <stdbool.h>
3#include <stdio.h> 2#include <stdio.h>
4#include <stdlib.h>
5#include <string.h> 3#include <string.h>
6 4
7#define N 1500 5#define N 1500
8#define M 15000
9#define MIN(x,y) ((x)<(y)?(x):(y))
10#define ischar(c) (c >= 'a' && c <= 'z') 6#define ischar(c) (c >= 'a' && c <= 'z')
11 7
12typedef struct { 8typedef struct { int nout, out[N]; char s[4], outc[N][4]; } node_t;
13 int nout, out[N];
14 char s[4], outc[N][4];
15} node_t;
16 9
17bool visited[N]; 10bool visited[N];
18char *buf, line[N][N]; 11char *buf, line[N][N];
@@ -90,6 +83,6 @@ int main() {
90 for (int t = 1; t < n; t++) 83 for (int t = 1; t < n; t++)
91 if (flowatmost(0, t, 3)) nother++; 84 if (flowatmost(0, t, 3)) nother++;
92 85
93 printf("%d (%d %d)\n", nother * (n-nother), nother, n-nother); 86 printf("%d\n", nother * (n-nother));
94 return 0; 87 return 0;
95} 88}

Generated with cgit - Back to sebastiano.tronto.net