From 8102eb9a838063611390cdab3c387b93020f34c7 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Thu, 6 Dec 2018 15:00:24 -0500 Subject: Solve day 6 part 2 --- 2018/day06.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '2018') 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); } -- cgit 1.4.1