Xnhyacinth's picture
Upload HarnessMix codegen train and held-out eval data
01a492e verified
Raw
History Blame Contribute Delete
2.64 kB
import subprocess
import sys
from pathlib import Path
cases = [{'input': '3 2 30 4\n6 14 25 48\n', 'output': '3'}, {'input': '123 1 2143435 4\n123 11 -5453 141245\n', 'output': '0'}, {'input': '123 1 2143435 4\n54343 -13 6 124\n', 'output': 'inf'}, {'input': '3 2 25 2\n379195692 -69874783\n', 'output': '4'}, {'input': '3 2 30 3\n-691070108 -934106649 -220744807\n', 'output': '4'}, {'input': '3 3 104 17\n9 -73896485 -290898562 5254410 409659728 -916522518 -435516126 94354167 262981034 -375897180 -80186684 -173062070 -288705544 -699097793 -11447747 320434295 503414250\n', 'output': '3'}, {'input': '-1000000000 -1000000000 1 1\n232512888\n', 'output': '0'}, {'input': '11 0 228 5\n-1 0 1 5 -11245\n', 'output': '1'}, {'input': '11 0 228 5\n-1 -17 1 5 -11245\n', 'output': 'inf'}, {'input': '0 0 2143435 5\n-1 -153 1 5 -11245\n', 'output': 'inf'}, {'input': '123 0 2143435 4\n5433 0 123 -645\n', 'output': '0'}, {'input': '123 -1 2143435 5\n-123 0 12 5 -11245\n', 'output': 'inf'}, {'input': '123 0 21 4\n543453 -123 6 1424\n', 'output': '0'}, {'input': '3 2 115 16\n24 48 12 96 3 720031148 -367712651 -838596957 558177735 -963046495 -313322487 -465018432 -618984128 -607173835 144854086 178041956\n', 'output': '1'}, {'input': '-3 0 92055 36\n-92974174 -486557474 -663622151 695596393 177960746 -563227474 -364263320 -676254242 -614140218 71456762 -764104225 705056581 -106398436 332755134 -199942822 -732751692 658942664 677739866 886535704 183687802 -784248291 -22550621 -938674499 637055091 -704750213 780395802 778342470 -999059668 -794361783 796469192 215667969 354336794 -60195289 -885080928 -290279020 201221317\n', 'output': 'inf'}, {'input': '0 -3 2143435 5\n-1 0 1 5 -11245\n', 'output': '0'}, {'input': '123 -1 2143435 5\n-123 0 123 -5453 141245\n', 'output': '0'}, {'input': '123 0 2143435 4\n5433 0 -123 -645\n', 'output': '1'}, {'input': '11 0 2 5\n-1 0 1 5 -11245\n', 'output': '0'}, {'input': '2 2 4 1\n2\n', 'output': '1'}]
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')