-
Notifications
You must be signed in to change notification settings - Fork 2
/
starter.py
44 lines (38 loc) · 1.5 KB
/
starter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import os # NOQA
import sys # NOQA
import re # NOQA
import math # NOQA
import fileinput
from string import ascii_uppercase, ascii_lowercase # NOQA
from collections import Counter, defaultdict, deque, namedtuple # NOQA
from itertools import count, product, permutations, combinations, combinations_with_replacement # NOQA
from utils import parse_line, parse_nums, mul, all_unique, factors, memoize, primes # NOQA
from utils import chunks, gcd, lcm, print_grid, min_max_xy # NOQA
from utils import new_table, transposed, rotated # NOQA
from utils import md5, sha256, knot_hash # NOQA
from utils import VOWELS, CONSONANTS # NOQA
from utils import Point, DIRS, DIRS_4, DIRS_8 # NOQA
# Itertools Functions:
# product('ABCD', repeat=2) AA AB AC AD BA BB BC BD CA CB CC CD DA DB DC DD
# permutations('ABCD', 2) AB AC AD BA BC BD CA CB CD DA DB DC
# combinations('ABCD', 2) AB AC AD BC BD CD
# combinations_with_replacement('ABCD', 2) AA AB AC AD BB BC BD CC CD DD
# It's Intcode time again!
# from intcode import emulate
# TAPE = [int(x) for x in fileinput.input()[0].split(',')]
# TAPE += [0] * 100000
# GLOBAL_INPUTS = [0]
# vm = emulate(TAPE, 0, GLOBAL_INPUTS)
# try:
# resp = next(vm)
# except StopIteration:
# pass
total = 0
result = []
table = new_table(None, width=2, height=4)
for i, line in enumerate(fileinput.input()):
line = line.strip()
nums = parse_nums(line)
data = parse_line(r'', line)
if i == 0:
print(data)