コード例 #1
0
def test_main():
    in_str = """
6
2
1 6 9 3 6 7    
    """.strip()
    assert get_output_with_stdin(main, in_str) == "5"
コード例 #2
0
ファイル: p1593.py プロジェクト: jms7446/hackerrank
def test_main():
    in_str = """
4 11
cAda
AbrAcadAbRa
""".strip()
    assert get_output_with_stdin(main, in_str) == "2"
コード例 #3
0
ファイル: test_p9328_keys.py プロジェクト: jms7446/hackerrank
def test_main():
    in_str = """
3
5 17
*****************
.............**$*
*B*A*P*C**X*Y*.X.
*y*x*a*p**$*$**$*
*****************
cz
5 11
*.*********
*...*...*x*
*X*.*.*.*.*
*$*...*...*
***********
0
7 7
*ABCDE*
X.....F
W.$$$.G
V.$$$.H
U.$$$.J
T.....K
*SQPML*
irony    
    """.strip()
    expected = """
3
1
0    
""".strip()
    assert get_output_with_stdin(main, in_str) == expected
コード例 #4
0
def test_main():
    in_str = """
3
6 8 9
5
2 5 2 4 7    
""".strip()
    assert get_output_with_stdin(main, in_str) == "2"
コード例 #5
0
def test_main():
    in_str = """
3 6
antarctica
antahellotica
antacartica
""".strip()
    assert get_output_with_stdin(main, in_str) == "2"
コード例 #6
0
def test_main():
    in_str = """
3
1 5 10
3 1 5
5 3 7
""".strip()
    assert get_output_with_stdin(main, in_str) == "14"
コード例 #7
0
def test_main():
    in_str = """
1
2 3
1 2
1 2
1 2
""".strip()
    assert get_output_with_stdin(main, in_str) == "2"
コード例 #8
0
ファイル: p1697.py プロジェクト: jms7446/hackerrank
def test_main():
    in_str = '''
5 17
    '''.strip()

    out_str = '''
4
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #9
0
ファイル: p1072.py プロジェクト: jms7446/hackerrank
def test_main4():
    in_str = '''
1000000000 999999999
    '''.strip()

    out_str = '''
-1
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #10
0
ファイル: p1072.py プロジェクト: jms7446/hackerrank
def test_main6():
    in_str = '''
5377378 4800373
    '''.strip()

    out_str = '''
392672
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #11
0
ファイル: p1072.py プロジェクト: jms7446/hackerrank
def test_main3():
    in_str = '''
0 0
    '''.strip()

    out_str = '''
1
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #12
0
ファイル: p1072.py プロジェクト: jms7446/hackerrank
def test_main2():
    in_str = '''
100 80
    '''.strip()

    out_str = '''
6
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #13
0
ファイル: p1072.py プロジェクト: jms7446/hackerrank
def test_main5():
    in_str = '''
5 5
    '''.strip()

    out_str = '''
-1
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #14
0
ファイル: p1697.py プロジェクト: jms7446/hackerrank
def test_main():
    in_str = '''
10000 100000
    '''.strip()

    out_str = '''
2503
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #15
0
ファイル: p2151.py プロジェクト: jms7446/hackerrank
def test_main():
    in_str = """
5
***#*
*.!.*
*!.!*
*.!.*
*#***
""".strip()
    assert get_output_with_stdin(main, in_str) == "2"
コード例 #16
0
def test_main2():
    in_str = '''
9 1
1 2 3 4 5 6 7 8 9
    '''.strip()

    out_str = '''
45
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #17
0
def test_main():
    inputs = """
4 3
0
2 1 2
1 3
3 2 3 4
    """.strip()
    outputs = "3"
    assert get_output_with_stdin(main, inputs) == outputs
コード例 #18
0
def test_main():
    in_str = '''
5
1 1 1 6 0
2 7 8 3 1
    '''.strip()

    out_str = '''
18
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #19
0
def test_main():
    in_str = '''
3 3
1 2 10
1 3 9
2 3 -3
    '''.strip()
    out_str = '''
7
    '''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #20
0
ファイル: p5555.py プロジェクト: jms7446/hackerrank
def test_main2():
    in_str = '''
XYZ
1
ZAAAAAAAXY
    '''.strip()

    out_str = '''
1
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #21
0
ファイル: p1089.py プロジェクト: jms7446/hackerrank
def test_main():
    in_str = """
2
###.###
#.#.#.#
#.#.###
#.#...#
###.###    
""".strip()
    res = float(get_output_with_stdin(main, in_str))
    print(res, file=sys.stderr)
    assert res == pytest.approx(48.5)
コード例 #22
0
def test_main2():
    in_str = '''
4 4
1 2 -1
2 3 -3
1 1 -1
3 4 1
    '''.strip()
    out_str = '''
-1
    '''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #23
0
ファイル: p5555.py プロジェクト: jms7446/hackerrank
def test_main3():
    in_str = '''
PQR
3
PQRAAAAPQR
BBPQRBBBBB
CCCCCCCCCC
    '''.strip()

    out_str = '''
2
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #24
0
ファイル: p5555.py プロジェクト: jms7446/hackerrank
def test_main():
    in_str = '''
ABCD
3
ABCDXXXXXX
YYYYABCDXX
DCBAZZZZZZ
    '''.strip()

    out_str = '''
2
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #25
0
ファイル: p5046.py プロジェクト: jms7446/hackerrank
def test_main():
    in_str = '''
3 1000 2 3
200
0 2 2
300
27 3 20    
    '''.strip()

    out_str = '''
900
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #26
0
def test_main():
    in_str = '''
4
bar
abracadabra
bear
bar
baraxbara
    '''.strip()

    out_str = '''
3
'''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #27
0
ファイル: pre2.py プロジェクト: jms7446/hackerrank
def test_main(in_str, out_str):
    in_str = '''
4
12 0
10 14
4 20
5 2147483648    
    '''
    out_str = '''
1
2
0
1
    '''
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #28
0
def test_main():
    inputs = """
4
1
4
10
100
    """.strip()
    outputs = """
1
4
5
5
    """.strip()
    assert result_check.get_output_with_stdin(main, inputs).strip() == outputs
コード例 #29
0
def test_main():
    in_str = '''
30
50
55
60
65
70
75
80
85
90
95
100
105
110
115
120
125
130
135
140
145
150
155
160
165
170
175
180
185
    '''.strip()
    out_str = '''
3 4 2 3 3 13
    '''.strip()
    assert get_output_with_stdin(main, in_str) == out_str
コード例 #30
0
def test_main(inputs, outputs):
    inputs = inputs.strip()
    assert get_output_with_stdin(main, inputs) == outputs