Example #1
0
def foun(f):
    '''Main driver to solve this problem.'''
    lines = ro.read_lines(f)
    (N, m), a = map(int, lines[0].split()), map(int, lines[1].split())
    b = np.zeros((m, len(a)))
    for j, aj in enumerate(a): b[:, j] = [np.log10(x[0]) for x in it.islice(ro.wf_pmf(2*N, aj), m)]
    np.savetxt(sys.stdout, b, '%f')
Example #2
0
def wfmd(f):
    '''Main driver to solve this problem.'''
    N, m, g, k = ro.read_ints_str(f)
    n = 2 * N
    return sum(it.islice(ro.wf_pmf(n, m), g - 1, g).next()[:n - k + 1])