summary refs log tree commit diff homepage
path: root/2018
diff options
context:
space:
mode:
Diffstat (limited to '2018')
-rw-r--r--2018/day06.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/2018/day06.c b/2018/day06.c
index 5b9552d..c204264 100644
--- a/2018/day06.c
+++ b/2018/day06.c
@@ -49,4 +49,16 @@ int main() {
 		if (area[i] > max) max = area[i];
 	}
 	printf("%d\n", max);
+
+	int size = 0;
+	for (int x = 0; x <= maxX; ++x) {
+		for (int y = 0; y <= maxY; ++y) {
+			int sum = 0;
+			for (int i = 0; i < len; ++i) {
+				sum += dist((struct Point) { x, y }, points[i]);
+			}
+			if (sum < 10000) size++;
+		}
+	}
+	printf("%d\n", size);
 }
rate tags fileJune McEnroe 2020-08-15Just use CLOCK_MONOTONIC and clean up includesJune McEnroe CLOCK_MONOTONIC exists everywhere. 2020-08-15Reap childrenJune McEnroe 2020-08-14Implement serviceSignal, serviceStop, serviceRestartJune McEnroe 2020-08-14Reset restartInterval and restartDeadline on startJune McEnroe 2020-08-14Switch to timespec for timeoutsJune McEnroe Can be passed to ppoll(2) directly. 2020-08-14Implement serviceStartJune McEnroe 2020-08-14Flesh out Service structJune McEnroe 2020-08-14Build environment for servicesJune McEnroe 2020-08-14Implement spawntab parsingJune McEnroe 2020-08-14Open syslog, daemonize, write PIDJune McEnroe 2020-08-14Implement user and group lookupJune McEnroe 2020-08-14Add install targetJune McEnroe 2020-08-14Add spawnd skeletonJune McEnroe