summaryrefslogtreecommitdiffstats
path: root/solutions/py/02-2.py
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2019-12-04 16:11:40 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2019-12-04 16:11:40 +0100
commit1183c0b152d61d315ba5924dbbde8eb62924abee (patch)
treee7cb9598f19e284d0ca7a2395155520964df2540 /solutions/py/02-2.py
parent00ceae21bd2de413a8ca7cc3ea978fd52cba8c80 (diff)
downloadaoc-1183c0b152d61d315ba5924dbbde8eb62924abee.tar.gz
Day 2 cpp
Diffstat (limited to 'solutions/py/02-2.py')
-rw-r--r--solutions/py/02-2.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/solutions/py/02-2.py b/solutions/py/02-2.py
index 2949629..cc6402e 100644
--- a/solutions/py/02-2.py
+++ b/solutions/py/02-2.py
@@ -1,6 +1,9 @@
import sys
+import time
-program = [int(x) for x in input().split(",")]
+program = [int(x) for x in input().split(" ")]
+
+start = time.time()
for n in range(100):
for v in range(100):
@@ -17,7 +20,9 @@ for n in range(100):
elif memory[pointer] == 2:
memory[memory[pointer+3]] = memory[memory[pointer+1]] * memory[memory[pointer+2]]
pointer += 4
- print(n, v, memory[0])
+ # print(n, v, memory[0])
if memory[0] == 19690720:
+ print(n, v)
+ print("took " + str(time.time() - start))
sys.exit()