summary refs log tree commit diff homepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--2018/day04.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/2018/day04.c b/2018/day04.c
index 5d2939f..78506ab 100644
--- a/2018/day04.c
+++ b/2018/day04.c
@@ -42,4 +42,14 @@ int main() {
 		maxMin = m;
 	}
 	printf("%u\n", maxID * maxMin);
+	maxID = maxMin = maxSleep = 0;
+	for (uint i = 0; i < Len; ++i) {
+		for (uint m = 0; m < 60; ++m) {
+			if (guards[i][m] < maxSleep) continue;
+			maxSleep = guards[i][m];
+			maxMin = m;
+			maxID = i;
+		}
+	}
+	printf("%u\n", maxID * maxMin);
 }