summary refs log tree commit diff stats
path: root/day23.c
diff options
context:
space:
mode:
authorBrian Chu <brianmchu42@gmail.com>2022-02-21 00:11:06 -0800
committerBrian Chu <brianmchu42@gmail.com>2022-02-21 00:11:06 -0800
commit0a4fe70d367f0bf1a78602af600052f58a377c34 (patch)
tree69c2bcd2b54b48968fd52728aaf0e21ca154784c /day23.c
parent1e2642d8793e6a4fb6cba16cd651d5fdca3e4581 (diff)
downloadAdventOfCode2017-main.tar.gz
solutions to day 25 main
Diffstat (limited to 'day23.c')
-rw-r--r--day23.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/day23.c b/day23.c
new file mode 100644
index 0000000..9622fdc
--- /dev/null
+++ b/day23.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+// decompiled assembly from the original problem specification
+int main() {
+    int b = 81;
+    int c = b;
+    int h = 0;
+    b = 100 * b + 100000;
+    c = b + 17000;
+    for (; b<= c; b += 17) {
+        int d = 2;
+        while (d != b) {
+            if (b % d == 0) {
+                ++h;
+                d = b;
+            } else {
+                ++d;
+            }
+        }
+    }
+    printf("%d", h);
+    return 0;
+}
\ No newline at end of file