summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-12-02 09:30:07 +0100
committertomsmeding <tom.smeding@gmail.com>2017-12-02 09:30:07 +0100
commit2c1dccf57d7ad5e25e79063dea41fd7bfa9d9ac6 (patch)
tree6c36355ef1a475f2b7cf388402afc96a16588d3d
parent2d02f553aa4cc4ded630628eccdf34f55937cee5 (diff)
Move 2016 to its own folder
-rw-r--r--2016/1.in (renamed from 1.in)0
-rw-r--r--2016/1a.out (renamed from 1a.out)0
-rwxr-xr-x2016/1a.py (renamed from 1a.py)0
-rw-r--r--2016/1a.rip (renamed from 1a.rip)0
-rw-r--r--2016/1b.out (renamed from 1b.out)0
-rwxr-xr-x2016/1b.py (renamed from 1b.py)0
-rw-r--r--2016/2.in (renamed from 2.in)0
-rw-r--r--2016/2a.out (renamed from 2a.out)0
-rwxr-xr-x2016/2a.py (renamed from 2a.py)0
-rw-r--r--2016/2b.out (renamed from 2b.out)0
-rwxr-xr-x2016/2b.py (renamed from 2b.py)0
-rw-r--r--2016/3.in (renamed from 3.in)0
-rw-r--r--2016/3a.out (renamed from 3a.out)0
-rwxr-xr-x2016/3a.py (renamed from 3a.py)0
-rw-r--r--2016/3b.out (renamed from 3b.out)0
-rwxr-xr-x2016/3b.py (renamed from 3b.py)0
-rw-r--r--2016/4.in (renamed from 4.in)0
-rw-r--r--2016/4a.out (renamed from 4a.out)0
-rwxr-xr-x2016/4a.py (renamed from 4a.py)0
-rw-r--r--2016/4b.out (renamed from 4b.out)0
-rwxr-xr-x2016/4b.py (renamed from 4b.py)0
-rw-r--r--2016/5.in (renamed from 5.in)0
-rw-r--r--2016/5a.c (renamed from 5a.c)0
-rw-r--r--2016/5a.out (renamed from 5a.out)0
-rw-r--r--2016/5b.c (renamed from 5b.c)0
-rw-r--r--2016/5b.out (renamed from 5b.out)0
-rw-r--r--2016/6.in (renamed from 6.in)0
-rw-r--r--2016/6a.out (renamed from 6a.out)0
-rwxr-xr-x2016/6a.py (renamed from 6a.py)0
-rw-r--r--2016/6b.out (renamed from 6b.out)0
-rwxr-xr-x2016/6b.py (renamed from 6b.py)0
-rw-r--r--2016/7.in (renamed from 7.in)0
-rw-r--r--2016/7a.out (renamed from 7a.out)0
-rwxr-xr-x2016/7a.py (renamed from 7a.py)0
-rw-r--r--2016/7b.out (renamed from 7b.out)0
-rwxr-xr-x2016/7b.py (renamed from 7b.py)0
-rw-r--r--2016/8.in (renamed from 8.in)0
-rw-r--r--2016/8a.out (renamed from 8a.out)0
-rwxr-xr-x2016/8a.py (renamed from 8a.py)0
-rw-r--r--2016/8b.out (renamed from 8b.out)0
-rwxr-xr-x2016/8b.py (renamed from 8b.py)0
-rw-r--r--2016/9.in (renamed from 9.in)0
-rw-r--r--2016/9a.out (renamed from 9a.out)0
-rwxr-xr-x2016/9a.py (renamed from 9a.py)0
-rw-r--r--2016/9b.out1
-rwxr-xr-x2016/9b.py21
-rw-r--r--2016/Makefile (renamed from Makefile)0
-rwxr-xr-x2016/test.sh (renamed from test.sh)0
48 files changed, 22 insertions, 0 deletions
diff --git a/1.in b/2016/1.in
index 5175324..5175324 100644
--- a/1.in
+++ b/2016/1.in
diff --git a/1a.out b/2016/1a.out
index 697cb3a..697cb3a 100644
--- a/1a.out
+++ b/2016/1a.out
diff --git a/1a.py b/2016/1a.py
index b074711..b074711 100755
--- a/1a.py
+++ b/2016/1a.py
diff --git a/1a.rip b/2016/1a.rip
index c8a2575..c8a2575 100644
--- a/1a.rip
+++ b/2016/1a.rip
diff --git a/1b.out b/2016/1b.out
index 3f7d191..3f7d191 100644
--- a/1b.out
+++ b/2016/1b.out
diff --git a/1b.py b/2016/1b.py
index cc24f76..cc24f76 100755
--- a/1b.py
+++ b/2016/1b.py
diff --git a/2.in b/2016/2.in
index bb27f07..bb27f07 100644
--- a/2.in
+++ b/2016/2.in
diff --git a/2a.out b/2016/2a.out
index 4b6e78b..4b6e78b 100644
--- a/2a.out
+++ b/2016/2a.out
diff --git a/2a.py b/2016/2a.py
index d01793f..d01793f 100755
--- a/2a.py
+++ b/2016/2a.py
diff --git a/2b.out b/2016/2b.out
index 98591aa..98591aa 100644
--- a/2b.out
+++ b/2016/2b.out
diff --git a/2b.py b/2016/2b.py
index 2fe50f3..2fe50f3 100755
--- a/2b.py
+++ b/2016/2b.py
diff --git a/3.in b/2016/3.in
index b431d7f..b431d7f 100644
--- a/3.in
+++ b/2016/3.in
diff --git a/3a.out b/2016/3a.out
index b7f96df..b7f96df 100644
--- a/3a.out
+++ b/2016/3a.out
diff --git a/3a.py b/2016/3a.py
index adc7f60..adc7f60 100755
--- a/3a.py
+++ b/2016/3a.py
diff --git a/3b.out b/2016/3b.out
index 239cbd5..239cbd5 100644
--- a/3b.out
+++ b/2016/3b.out
diff --git a/3b.py b/2016/3b.py
index ed2e87f..ed2e87f 100755
--- a/3b.py
+++ b/2016/3b.py
diff --git a/4.in b/2016/4.in
index 7dcc997..7dcc997 100644
--- a/4.in
+++ b/2016/4.in
diff --git a/4a.out b/2016/4a.out
index 463e022..463e022 100644
--- a/4a.out
+++ b/2016/4a.out
diff --git a/4a.py b/2016/4a.py
index e5dfe7f..e5dfe7f 100755
--- a/4a.py
+++ b/2016/4a.py
diff --git a/4b.out b/2016/4b.out
index c15fb72..c15fb72 100644
--- a/4b.out
+++ b/2016/4b.out
diff --git a/4b.py b/2016/4b.py
index a9b631b..a9b631b 100755
--- a/4b.py
+++ b/2016/4b.py
diff --git a/5.in b/2016/5.in
index a734d02..a734d02 100644
--- a/5.in
+++ b/2016/5.in
diff --git a/5a.c b/2016/5a.c
index d8bbd7f..d8bbd7f 100644
--- a/5a.c
+++ b/2016/5a.c
diff --git a/5a.out b/2016/5a.out
index fb879cb..fb879cb 100644
--- a/5a.out
+++ b/2016/5a.out
diff --git a/5b.c b/2016/5b.c
index 4d575fb..4d575fb 100644
--- a/5b.c
+++ b/2016/5b.c
diff --git a/5b.out b/2016/5b.out
index 7b2641f..7b2641f 100644
--- a/5b.out
+++ b/2016/5b.out
diff --git a/6.in b/2016/6.in
index 63e00cd..63e00cd 100644
--- a/6.in
+++ b/2016/6.in
diff --git a/6a.out b/2016/6a.out
index f1668f7..f1668f7 100644
--- a/6a.out
+++ b/2016/6a.out
diff --git a/6a.py b/2016/6a.py
index 98d6c57..98d6c57 100755
--- a/6a.py
+++ b/2016/6a.py
diff --git a/6b.out b/2016/6b.out
index 6eaaa0a..6eaaa0a 100644
--- a/6b.out
+++ b/2016/6b.out
diff --git a/6b.py b/2016/6b.py
index 1d9ec0d..1d9ec0d 100755
--- a/6b.py
+++ b/2016/6b.py
diff --git a/7.in b/2016/7.in
index fb0a641..fb0a641 100644
--- a/7.in
+++ b/2016/7.in
diff --git a/7a.out b/2016/7a.out
index f96ac06..f96ac06 100644
--- a/7a.out
+++ b/2016/7a.out
diff --git a/7a.py b/2016/7a.py
index adf8f76..adf8f76 100755
--- a/7a.py
+++ b/2016/7a.py
diff --git a/7b.out b/2016/7b.out
index 8c9cf7e..8c9cf7e 100644
--- a/7b.out
+++ b/2016/7b.out
diff --git a/7b.py b/2016/7b.py
index ea31643..ea31643 100755
--- a/7b.py
+++ b/2016/7b.py
diff --git a/8.in b/2016/8.in
index 7aafb94..7aafb94 100644
--- a/8.in
+++ b/2016/8.in
diff --git a/8a.out b/2016/8a.out
index 9289ddc..9289ddc 100644
--- a/8a.out
+++ b/2016/8a.out
diff --git a/8a.py b/2016/8a.py
index 3ba44b0..3ba44b0 100755
--- a/8a.py
+++ b/2016/8a.py
diff --git a/8b.out b/2016/8b.out
index d8cd9a5..d8cd9a5 100644
--- a/8b.out
+++ b/2016/8b.out
diff --git a/8b.py b/2016/8b.py
index 9c21f25..9c21f25 100755
--- a/8b.py
+++ b/2016/8b.py
diff --git a/9.in b/2016/9.in
index a4f16dc..a4f16dc 100644
--- a/9.in
+++ b/2016/9.in
diff --git a/9a.out b/2016/9a.out
index 0d5cd74..0d5cd74 100644
--- a/9a.out
+++ b/2016/9a.out
diff --git a/9a.py b/2016/9a.py
index 2bba4a2..2bba4a2 100755
--- a/9a.py
+++ b/2016/9a.py
diff --git a/2016/9b.out b/2016/9b.out
new file mode 100644
index 0000000..534bc25
--- /dev/null
+++ b/2016/9b.out
@@ -0,0 +1 @@
+10762972461
diff --git a/2016/9b.py b/2016/9b.py
new file mode 100755
index 0000000..9df3005
--- /dev/null
+++ b/2016/9b.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+
+import sys
+
+def decomplen(s):
+ total=0
+ i=0
+ while i<len(s):
+ if s[i]=="(":
+ closeidx=s.index(")",i+1)
+ marker=[int(x) for x in s[i+1:closeidx].split("x")]
+ repstr=s[closeidx+1:closeidx+1+marker[0]]
+ total+=marker[1]*decomplen(repstr)
+ i=closeidx+1+marker[0]
+ else:
+ total+=1
+ i+=1
+
+ return total
+
+print(decomplen(sys.stdin.readline()[:-1]))
diff --git a/Makefile b/2016/Makefile
index 87abe17..87abe17 100644
--- a/Makefile
+++ b/2016/Makefile
diff --git a/test.sh b/2016/test.sh
index 78d4a5a..78d4a5a 100755
--- a/test.sh
+++ b/2016/test.sh