Xnhyacinth's picture
Upload HarnessMix codegen train and held-out eval data
01a492e verified
Raw
History Blame Contribute Delete
3.28 kB
import subprocess
import sys
from pathlib import Path
cases = [{'input': '3\n1 3 5\n', 'output': 'Yes\n'}, {'input': '5\n1 0 1 5 1\n', 'output': 'Yes\n'}, {'input': '3\n4 3 1\n', 'output': 'No\n'}, {'input': '4\n3 9 9 3\n', 'output': 'No\n'}, {'input': '1\n1\n', 'output': 'Yes\n'}, {'input': '5\n100 99 100 99 99\n', 'output': 'No\n'}, {'input': '100\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100\n', 'output': 'No\n'}, {'input': '1\n0\n', 'output': 'No\n'}, {'input': '2\n1 1\n', 'output': 'No\n'}, {'input': '2\n10 10\n', 'output': 'No\n'}, {'input': '2\n54 21\n', 'output': 'No\n'}, {'input': '5\n0 0 0 0 0\n', 'output': 'No\n'}, {'input': '5\n67 92 0 26 43\n', 'output': 'Yes\n'}, {'input': '15\n45 52 35 80 68 80 93 57 47 32 69 23 63 90 43\n', 'output': 'Yes\n'}, {'input': '15\n81 28 0 82 71 64 63 89 87 92 38 30 76 72 36\n', 'output': 'No\n'}, {'input': '50\n49 32 17 59 77 98 65 50 85 10 40 84 65 34 52 25 1 31 61 45 48 24 41 14 76 12 33 76 44 86 53 33 92 58 63 93 50 24 31 79 67 50 72 93 2 38 32 14 87 99\n', 'output': 'No\n'}, {'input': '55\n65 69 53 66 11 100 68 44 43 17 6 66 24 2 6 6 61 72 91 53 93 61 52 96 56 42 6 8 79 49 76 36 83 58 8 43 2 90 71 49 80 21 75 13 76 54 95 61 58 82 40 33 73 61 46\n', 'output': 'No\n'}, {'input': '99\n73 89 51 85 42 67 22 80 75 3 90 0 52 100 90 48 7 15 41 1 54 2 23 62 86 68 2 87 57 12 45 34 68 54 36 49 27 46 22 70 95 90 57 91 90 79 48 89 67 92 28 27 25 37 73 66 13 89 7 99 62 53 48 24 73 82 62 88 26 39 21 86 50 95 26 27 60 6 56 14 27 90 55 80 97 18 37 36 70 2 28 53 36 77 39 79 82 42 69\n', 'output': 'Yes\n'}, {'input': '99\n99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99\n', 'output': 'Yes\n'}, {'input': '100\n61 63 34 45 20 91 31 28 40 27 94 1 73 5 69 10 56 94 80 23 79 99 59 58 13 56 91 59 77 78 88 72 80 72 70 71 63 60 41 41 41 27 83 10 43 14 35 48 0 78 69 29 63 33 42 67 1 74 51 46 79 41 37 61 16 29 82 28 22 14 64 49 86 92 82 55 54 24 75 58 95 31 3 34 26 23 78 91 49 6 30 57 27 69 29 54 42 0 61 83\n', 'output': 'No\n'}]
solution = Path(__file__).with_name("solution.py")
for index, case in enumerate(cases):
proc = subprocess.run(
[sys.executable, str(solution)],
input=case["input"],
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
timeout=10,
)
if proc.returncode != 0:
raise AssertionError(f"case {index} exited {proc.returncode}: {proc.stderr}")
got = proc.stdout.strip()
expected = case["output"].strip()
if got.split() != expected.split():
raise AssertionError(
f"case {index} output mismatch\nexpected={expected!r}\ngot={got!r}\nstderr={proc.stderr}"
)
print('deepcoder_primeintellect_io')