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 sys | |
import argparse | |
import itertools as it | |
import numpy as np | |
def flipper(n): | |
def cool_range_doritos(*args, **kwargs): | |
if sys.version_info[0] < 3: | |
return xrange(*args, **kwargs) |
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 math | |
# Get the value of n and initialize the matrices A and B. | |
with open("input.txt", "r") as matrix_info: | |
n = int(matrix_info.readline()) | |
assert n == 2 ** math.log(n, 2), "The first line must be a power of 2." | |
mat_a = [] | |
mat_b = [] |
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 numpy as np | |
import csv | |
def compute_sum(infile): | |
""" | |
Returns the sum of numbers in a file with one column and a header row. | |
Parameters | |
---------- | |
infile : File object |
NewerOlder