Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
44 lines (38 sloc)
1.5 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |