codegen / assets /train /deepcoder_primeintellect /deepcoder_primeintellect_08cde72754a853ea /test_solution.py
| import subprocess | |
| import sys | |
| from pathlib import Path | |
| cases = [{'input': '3 8\n2 4 6\n1 5 7\n', 'output': 'YES\n'}, {'input': '4 9\n2 3 5 8\n0 1 3 6\n', 'output': 'YES\n'}, {'input': '2 4\n1 3\n1 2\n', 'output': 'NO\n'}, {'input': '5 9\n0 2 5 6 7\n1 3 6 7 8\n', 'output': 'YES\n'}, {'input': '5 60\n7 26 27 40 59\n14 22 41 42 55\n', 'output': 'YES\n'}, {'input': '20 29\n0 1 2 4 5 8 9 12 14 15 17 19 20 21 22 23 25 26 27 28\n0 2 4 5 6 7 8 10 11 12 13 14 15 16 18 19 22 23 26 28\n', 'output': 'YES\n'}, {'input': '35 41\n0 1 2 3 4 5 6 7 9 10 11 12 13 14 18 19 20 21 22 23 24 25 26 28 30 31 32 33 34 35 36 37 38 39 40\n0 1 2 3 4 5 7 8 9 10 11 12 16 17 18 19 20 21 22 23 24 26 28 29 30 31 32 33 34 35 36 37 38 39 40\n', 'output': 'YES\n'}, {'input': '40 63\n0 2 3 4 5 6 9 10 12 15 17 19 23 25 26 27 28 29 30 31 33 34 36 37 38 39 40 43 45 49 50 52 53 54 55 57 58 60 61 62\n1 2 3 4 5 8 10 14 15 17 18 19 20 22 23 25 26 27 28 30 31 32 33 34 37 38 40 43 46 47 51 53 54 55 56 57 58 59 61 62\n', 'output': 'NO\n'}, {'input': '50 97\n1 2 3 4 6 9 10 11 12 13 14 21 22 23 24 25 28 29 30 31 32 33 34 36 37 40 41 45 53 56 59 64 65 69 70 71 72 73 74 77 81 84 85 86 87 89 91 92 95 96\n0 1 2 3 6 10 13 14 15 16 18 20 21 24 25 27 28 29 30 33 35 36 37 38 39 40 47 48 49 50 51 54 55 56 57 58 59 60 62 63 66 67 71 79 82 85 90 91 95 96\n', 'output': 'NO\n'}, {'input': '50 100\n0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98\n1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99\n', 'output': 'YES\n'}, {'input': '1 2\n0\n0\n', 'output': 'YES\n'}, {'input': '1 2\n0\n1\n', 'output': 'YES\n'}, {'input': '1 2\n1\n0\n', 'output': 'YES\n'}, {'input': '1 2\n1\n1\n', 'output': 'YES\n'}, {'input': '1 1\n0\n0\n', 'output': 'YES\n'}, {'input': '5 12\n2 3 4 8 10\n2 3 4 8 10\n', 'output': 'YES\n'}, {'input': '1 18\n3\n10\n', 'output': 'YES\n'}, {'input': '1 75\n65\n8\n', 'output': 'YES\n'}, {'input': '2 16\n4 13\n2 11\n', 'output': 'YES\n'}, {'input': '2 95\n45 59\n3 84\n', 'output': 'YES\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') | |