11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
+
+
+
+
+
+
+
|
/* === aocYYYYDD =======================================================
===================================================================== */
void aocYYYYDD(char *data, size_t len) {
(void)len; // unused argument
}
#endif
/* === aoc202510 =======================================================
===================================================================== */
void aoc202510(char *data, size_t len) {
(void)len; // unused arguments
(void)data;
}
/* === aoc202509 =======================================================
===================================================================== */
struct iCoords {
int row, col;
};
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
-
-
+
+
|
if (*err != ',') break;
err++;
p[k++].col = strtol(err, &err, 10);
}
long long max_area = 0;
for (int i = 0; i < k; i++) {
for (int j = i + 1; j < k; j++) {
long long area = 1LL * (abs(p[i].col - p[j].col) + 1)
* (abs(p[i].row - p[j].row) + 1);
long long area = (abs(p[i].col - p[j].col) + 1LL)
* (abs(p[i].row - p[j].row) + 1LL);
if (area > max_area) max_area = area;
}
}
printf("P1: %lld\n", max_area);
}
/* === aoc202508 =======================================================
|