Esempio n. 1
0
def run_line(match):
    red = get_ints(match.group(1))
    green = get_ints(match.group(2))
    blue = get_ints(match.group(3))
    expected = int(match.group(4))
    actual = min_operations(red, green, blue)
    assert_equals(actual, expected)
Esempio n. 2
0
def run_line(match):
    a = get_ints(match.group(3))
    last_seen = get_ints(match.group(4))
    t = get_ints(match.group(5))
    expected = get_strings(match.group(6))
    actual = solve(a, last_seen, t)
    assert_equals(actual, expected)
Esempio n. 3
0
def run_line(match):
    n = int(match.group(1))
    a = get_ints(match.group(2))
    b = get_ints(match.group(3))
    expected = int(match.group(4))
    actual = solve(n, a, b)
    assert_equals(actual, expected)
Esempio n. 4
0
def run_line(match):
    C = int(match.group(1))
    F = int(match.group(2))
    sock_count = get_ints(match.group(3))
    expected = int(match.group(4))
    actual = fewest_socks(C, F, sock_count)
    assert_equals(actual, expected)
Esempio n. 5
0
def run_line(match):
    n = int(match.group(1))
    a = int(match.group(2))
    b = int(match.group(3))
    expected = int(match.group(4))
    actual = cheapest(n, a, b)
    assert_equals(actual, expected)
Esempio n. 6
0
def run_line(match):
    N = int(match.group(1))
    x = get_ints(match.group(2))
    t = get_ints(match.group(3))
    expected = int(match.group(4))
    actual = max_height(N, x, t)
    assert_equals(actual, expected)
Esempio n. 7
0
def run_line(match):
    need_mean = int(match.group(1))
    need_median = int(match.group(2))
    d = get_ints(match.group(3))
    expected = int(match.group(4))
    actual = min_effort(need_mean, need_median, d)
    assert_equals(actual, expected)
Esempio n. 8
0
def run_line(match):
    t = int(match.group(1))
    a = get_ints(match.group(2))
    b = get_ints(match.group(3))
    direct_cost = get_strings(match.group(4))
    expected = int(match.group(5))
    actual = minimize_cost(t, a, b, direct_cost)
    assert_equals(actual, expected)
Esempio n. 9
0
def run_line(match):
    w = int(match.group(1))
    h = int(match.group(2))
    w1 = int(match.group(3))
    h1 = int(match.group(4))
    expected = float(match.group(5))
    actual = success_probability(w, h, w1, h1)
    assert_equals(actual, expected)
Esempio n. 10
0
def run_line(match):
    water_width = int(match.group(1))
    land_width = int(match.group(2))
    block_height = get_ints(match.group(3))
    depth = int(match.group(4))
    expected = match.group(5)
    actual = is_it_even_possible(water_width, land_width, block_height, depth)
    assert_equals(actual, expected)
Esempio n. 11
0
def run_line(match):
    r1 = int(match.group(1))
    r2 = int(match.group(2))
    c1 = int(match.group(3))
    c2 = int(match.group(4))
    expected = int(match.group(5))
    actual = quardrant_sum(r1, r2, c1, c2)
    assert_equals(actual, expected)
Esempio n. 12
0
def run_line(match):
    n = int(match.group(1))
    b = int(match.group(2))
    up_to = get_ints(match.group(3))
    quantity = get_ints(match.group(4))
    expected = match.group(5)
    actual = is_fair(n, b, up_to, quantity)
    assert_equals(actual, expected)
Esempio n. 13
0
def run_line(match):
    global x
    global y
    x = get_ints(match.group(1))
    y = get_ints(match.group(2))
    expected = float(match.group(3))
    actual = largest(x, y)
    assert_equals(actual, expected)
Esempio n. 14
0
def run_line(match):
    width = int(match.group(1))
    height = int(match.group(2))
    size = int(match.group(3))
    max_allowed = int(match.group(4))
    expected = int(match.group(5))
    actual = most(width, height, size, max_allowed)
    assert_equals(actual, expected)
Esempio n. 15
0
def run_line(match):
    reels = get_ints(match.group(1))
    expected = get_ints(match.group(2))
    actual = reels_sort(reels)
    print("actual:", actual)
    if len(expected) == 1 and expected[0] == -1:
        assert_equals(actual, expected)
    if len(actual) == 1 and actual[0] == -1:
        assert_equals(actual, expected)
Esempio n. 16
0
def run_line(match):
    N = int(match.group(1))
    SX = int(match.group(2))
    SY = int(match.group(3))
    Xprefix = get_ints(match.group(4))
    Yprefix = get_ints(match.group(5))
    expected = int(match.group(6))
    actual = count_locations(N, SX, SY, Xprefix, Yprefix)
    assert_equals(actual, expected)
Esempio n. 17
0
def run_line(match):
    xl = get_ints(match.group(1))
    yl = get_ints(match.group(2))
    xh = get_ints(match.group(3))
    yh = get_ints(match.group(4))
    k = int(match.group(5))
    expected = int(match.group(6))
    actual = max_intersection(xl, yl, xh, yh, k)
    assert_equals(actual, expected)
Esempio n. 18
0
def run_line(match):
    f = int(match.group(1))
    m = int(match.group(2))
    data = get_ints(match.group(3))
    goal = int(match.group(4))
    expected_persons = int(match.group(5))
    expected_changes = int(match.group(6))
    expected = [expected_persons, expected_changes]
    actual = minimize(f, m, data, goal)
    assert_equals(actual, expected)
Esempio n. 19
0
def run_line(match):
    p = match.group(1)
    a0 = int(match.group(2))
    x = int(match.group(3))
    y = int(match.group(4))
    n = int(match.group(5))
    k = int(match.group(6))
    expected = int(match.group(7))
    actual = find_number_of_swaps(p, a0, x, y, n, k)
    assert_equals(actual, expected)
Esempio n. 20
0
def run_line(match):
    a = int(match.group(1))
    b = int(match.group(2))
    c = int(match.group(3))
    x = int(match.group(4))
    y = int(match.group(5))
    z = int(match.group(6))
    min_sum = int(match.group(7))
    cost = int(match.group(8))
    actual = do_delete(a, b, c, x, y, z)
    assert_equals(actual['min_sum'], min_sum)
    assert_equals(actual['cost'], cost)
Esempio n. 21
0
def run_line(match):
    a = get_ints(match.group(1))
    b = get_ints(match.group(2))
    expected = int(match.group(3))
    actual = minimal_planets(a, b)
    assert_equals(actual, expected)
Esempio n. 22
0
def run_line(match):
    sums = get_ints(match.group(1))
    expected = get_ints(match.group(2))
    actual = get_primes(sums)
    assert_equals(len(actual), len(expected))
Esempio n. 23
0
def run_line(match):
    n = int(match.group(1))
    index = int(match.group(2))
    expected = get_ints(match.group(3))
    actual = find_cell(n, index)
    assert_equals(actual, expected)
Esempio n. 24
0
def run_line(match):
    switches = get_strings(match.group(1))
    lamps = get_strings(match.group(2))
    expected = int(match.group(3))
    actual = the_min(switches, lamps)
    assert_equals(actual, expected)
Esempio n. 25
0
def run_line(match):
    candy = get_ints(match.group(1))
    bag_size = int(match.group(2))
    expected = int(match.group(3))
    actual = make_bags(candy, bag_size)
    assert_equals(actual, expected)
Esempio n. 26
0
def run_line(match):
    button_pressed = int(match.group(1))
    expected = int(match.group(2))
    actual = actual_floor(button_pressed)
    assert_equals(actual, expected)
Esempio n. 27
0
def run_line(match):
    a = match.group(1)
    b = match.group(2)
    expected = match.group(3)
    actual = add(a, b)
    assert_equals(actual, expected)
Esempio n. 28
0
def run_line(match):
    scores = get_ints(match.group(1))
    expected = float(match.group(2))
    actual = overall_score(scores)
    assert_equals(actual, expected)
Esempio n. 29
0
def run_line(match):
    x = int(match.group(1))
    expected = int(match.group(2))
    actual = get_min(x)
    assert_equals(actual, expected)
Esempio n. 30
0
def run_line(match):
    clipboard = get_strings(match.group(1))
    t = int(match.group(2))
    expected = get_ints(match.group(3))
    actual = count_colors(clipboard, t)
    assert_equals(actual, expected)