benchkit-cli 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- benchkit/__init__.py +1 -0
- benchkit/_pi_proxy.py +219 -0
- benchkit/answer_key_guard.ts +49 -0
- benchkit/artifacts.py +87 -0
- benchkit/benchmarks/__init__.py +105 -0
- benchkit/benchmarks/aider_polyglot.py +405 -0
- benchkit/benchmarks/arc.py +52 -0
- benchkit/benchmarks/banking77.py +149 -0
- benchkit/benchmarks/base.py +19 -0
- benchkit/benchmarks/boolq.py +49 -0
- benchkit/benchmarks/chartqa.py +133 -0
- benchkit/benchmarks/code_verifier.py +77 -0
- benchkit/benchmarks/downloads.py +166 -0
- benchkit/benchmarks/evalplus.py +288 -0
- benchkit/benchmarks/git_surgery.py +485 -0
- benchkit/benchmarks/gpqa.py +56 -0
- benchkit/benchmarks/gsm8k.py +97 -0
- benchkit/benchmarks/hellaswag.py +49 -0
- benchkit/benchmarks/humaneval.py +103 -0
- benchkit/benchmarks/ifeval.py +56 -0
- benchkit/benchmarks/ifeval_instructions.py +477 -0
- benchkit/benchmarks/mbpp.py +60 -0
- benchkit/benchmarks/mc_arena.py +479 -0
- benchkit/benchmarks/mcq.py +94 -0
- benchkit/benchmarks/medfailbench.py +537 -0
- benchkit/benchmarks/mmlu.py +54 -0
- benchkit/benchmarks/mmlu_pro.py +62 -0
- benchkit/benchmarks/mmvp.py +115 -0
- benchkit/benchmarks/ocrbench.py +96 -0
- benchkit/benchmarks/openbookqa.py +52 -0
- benchkit/benchmarks/patcheval.py +929 -0
- benchkit/benchmarks/piqa.py +52 -0
- benchkit/benchmarks/ruler.py +172 -0
- benchkit/benchmarks/ruler_generator.py +535 -0
- benchkit/benchmarks/sanity.py +174 -0
- benchkit/benchmarks/treejs_arena.py +268 -0
- benchkit/benchmarks/truthfulqa.py +52 -0
- benchkit/benchmarks/utils.py +25 -0
- benchkit/benchmarks/vision.py +230 -0
- benchkit/benchmarks/vstar.py +108 -0
- benchkit/benchmarks/winogrande.py +52 -0
- benchkit/benchmarks/xstest.py +116 -0
- benchkit/browser.py +429 -0
- benchkit/catalog.py +121 -0
- benchkit/cli.py +1000 -0
- benchkit/client.py +1413 -0
- benchkit/controls.py +87 -0
- benchkit/datasets/MMLU_LICENSE.txt +21 -0
- benchkit/datasets/README.md +142 -0
- benchkit/datasets/arc_challenge.jsonl +1172 -0
- benchkit/datasets/banking77.jsonl +3080 -0
- benchkit/datasets/banking77_intents.json +79 -0
- benchkit/datasets/boolq.jsonl +3270 -0
- benchkit/datasets/code_verifier.jsonl +500 -0
- benchkit/datasets/gpqa_diamond.jsonl +198 -0
- benchkit/datasets/gsm8k.jsonl +1319 -0
- benchkit/datasets/hellaswag.jsonl +1000 -0
- benchkit/datasets/humaneval.jsonl +164 -0
- benchkit/datasets/ifeval.jsonl +541 -0
- benchkit/datasets/mbpp.jsonl +500 -0
- benchkit/datasets/mc_blocks_1_20_1.jsonl +1003 -0
- benchkit/datasets/medfailbench_hard30.jsonl +30 -0
- benchkit/datasets/medfailbench_hard30.md +13 -0
- benchkit/datasets/openbookqa.jsonl +500 -0
- benchkit/datasets/piqa.jsonl +1838 -0
- benchkit/datasets/sanity_code.jsonl +6 -0
- benchkit/datasets/truthfulqa.jsonl +817 -0
- benchkit/datasets/winogrande.jsonl +1267 -0
- benchkit/datasets/xstest.csv +451 -0
- benchkit/decision.py +194 -0
- benchkit/demo.py +451 -0
- benchkit/dockerfiles.py +247 -0
- benchkit/engine.py +1270 -0
- benchkit/evaluation.py +195 -0
- benchkit/events.py +141 -0
- benchkit/executor.py +96 -0
- benchkit/git_surgery/backport-release-stack/setup.sh +328 -0
- benchkit/git_surgery/backport-release-stack/verify.sh +119 -0
- benchkit/git_surgery/bisect-the-regression/setup.sh +49 -0
- benchkit/git_surgery/bisect-the-regression/verify.sh +34 -0
- benchkit/git_surgery/rebase-conflict-chain/setup.sh +65 -0
- benchkit/git_surgery/rebase-conflict-chain/verify.sh +43 -0
- benchkit/git_surgery/recover-complex-stash/setup.sh +152 -0
- benchkit/git_surgery/recover-complex-stash/verify.sh +95 -0
- benchkit/git_surgery/recover-lost-work/setup.sh +40 -0
- benchkit/git_surgery/recover-lost-work/verify.sh +36 -0
- benchkit/git_surgery/repair-force-pushed-remote/setup.sh +171 -0
- benchkit/git_surgery/repair-force-pushed-remote/verify.sh +83 -0
- benchkit/git_surgery/revert-merge-with-followups/setup.sh +198 -0
- benchkit/git_surgery/revert-merge-with-followups/verify.sh +98 -0
- benchkit/git_surgery/secret-in-history/README.md +27 -0
- benchkit/git_surgery/secret-in-history/setup.sh +107 -0
- benchkit/git_surgery/secret-in-history/verify.sh +106 -0
- benchkit/git_surgery/split-the-mega-commit/setup.sh +50 -0
- benchkit/git_surgery/split-the-mega-commit/verify.sh +48 -0
- benchkit/git_surgery/untangle-nested-submodules/setup.sh +193 -0
- benchkit/git_surgery/untangle-nested-submodules/verify.sh +90 -0
- benchkit/history.py +474 -0
- benchkit/jobs.py +332 -0
- benchkit/leakage.py +51 -0
- benchkit/looping.py +873 -0
- benchkit/mc_render.py +274 -0
- benchkit/mc_viewer/dist/atlas.png +0 -0
- benchkit/mc_viewer/dist/blockStates.json.gz +0 -0
- benchkit/mc_viewer/dist/version.json +4 -0
- benchkit/mc_viewer/dist/viewer.html +23 -0
- benchkit/mc_viewer/dist/viewer.js +2 -0
- benchkit/mc_viewer/dist/viewer.js.LICENSE.txt +25 -0
- benchkit/mc_viewer/dist/worker.js +2 -0
- benchkit/mc_viewer/dist/worker.js.LICENSE.txt +19 -0
- benchkit/metrics.py +100 -0
- benchkit/ollama.py +60 -0
- benchkit/perf.py +353 -0
- benchkit/perf_report.py +207 -0
- benchkit/perturbations.py +208 -0
- benchkit/pi_agent.py +476 -0
- benchkit/pi_package/package-lock.json +1827 -0
- benchkit/pi_package/package.json +8 -0
- benchkit/report.py +142 -0
- benchkit/report_markdown.py +645 -0
- benchkit/results.py +688 -0
- benchkit/retry.py +163 -0
- benchkit/runner.py +769 -0
- benchkit/sandbox.py +1167 -0
- benchkit/template_check.py +291 -0
- benchkit/templates/arena.html +504 -0
- benchkit/templates/history.html +58 -0
- benchkit/templates/perf.html +509 -0
- benchkit/templates/report.html +769 -0
- benchkit/tui/__init__.py +5 -0
- benchkit/tui/app.py +87 -0
- benchkit/tui/app.tcss +512 -0
- benchkit/tui/formatting.py +84 -0
- benchkit/tui/screens/__init__.py +1 -0
- benchkit/tui/screens/connect.py +191 -0
- benchkit/tui/screens/detail.py +288 -0
- benchkit/tui/screens/help.py +84 -0
- benchkit/tui/screens/modals.py +544 -0
- benchkit/tui/screens/results.py +361 -0
- benchkit/tui/screens/run.py +988 -0
- benchkit/tui/screens/setup.py +733 -0
- benchkit/tui/theme.py +135 -0
- benchkit/tui/widgets.py +120 -0
- benchkit_cli-0.1.0.dist-info/METADATA +294 -0
- benchkit_cli-0.1.0.dist-info/RECORD +149 -0
- benchkit_cli-0.1.0.dist-info/WHEEL +5 -0
- benchkit_cli-0.1.0.dist-info/entry_points.txt +3 -0
- benchkit_cli-0.1.0.dist-info/licenses/LICENSE +201 -0
- benchkit_cli-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
{"id": "code-verifier/000", "task_id": "HumanEval/32", "entry_point": "find_zero", "prompt": "import math\n\n\ndef poly(xs: list, x: float):\n \"\"\"\n Evaluates polynomial with coefficients xs at point x.\n return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n\n \"\"\"\n return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)])\n\n\ndef find_zero(xs: list):\n \"\"\" xs are coefficients of a polynomial.\n find_zero find x such that poly(x) = 0.\n find_zero returns only only zero point, even if there are many.\n Moreover, find_zero only takes list xs having even number of coefficients\n and largest non zero coefficient as it guarantees\n a solution.\n >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x\n -0.5\n >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3\n 1.0\n \"\"\"\n", "solution": "import math\n\n\ndef poly(xs: list, x: float):\n \"\"\"\n Evaluates polynomial with coefficients xs at point x.\n return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n\n \"\"\"\n return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)])\n\n\ndef find_zero(xs: list):\n \"\"\" xs are coefficients of a polynomial.\n find_zero find x such that poly(x) = 0.\n find_zero returns only only zero point, even if there are many.\n Moreover, find_zero only takes list xs having even number of coefficients\n and largest non zero coefficient as it guarantees\n a solution.\n >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x\n -0.5\n >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3\n 1.0\n \"\"\"\n for i in range(len(xs)):\n if abs(xs[i]) > 1e-9:\n # Use bisection method or similar root-finding algorithm.\n # Since the problem statement guarantees a solution and implies\n # a method that finds *a* zero, we'll use a simple search or\n # rely on the structure implied by the examples.\n # For a general polynomial, finding roots is complex.\n # Given the constraints and examples, a numerical search is implied.\n\n # A simple approach for demonstration, though not robust for all cases:\n # Check a range of values or use a more sophisticated method.\n # Since the examples suggest simple roots, we might test simple values.\n\n # Let's implement a basic bisection method assuming we can bracket a root.\n # This is highly dependent on the nature of the polynomial.\n\n # Given the ambiguity, we'll stick to the simplest interpretation\n # that satisfies the examples, which often involves testing simple\n # values or using a library function if allowed (but we are not).\n\n # Since the problem implies a guaranteed solution and the examples\n # are simple, we'll try to find a root by checking small integers\n # or using a simple iterative solver if necessary.\n\n # For the sake of completion based on the examples:\n # Example 1: [1, 2] -> 1 + 2x = 0 -> x = -0.5\n # Example 2: [-6, 11, -6, 1] -> -6 + 11x - 6x^2 + x^3 = 0. Root at x=1.\n\n # If we assume the root is near 0 or 1 for simplicity:\n\n # Let's use a simple iterative search around 0, which is often sufficient\n # for introductory problems, although mathematically unsound for all cases.\n\n low = -10.0\n high = 10.0\n\n # A more robust approach would involve Sturm's theorem or numerical methods.\n # Given the context, we'll use a simple fixed-point iteration or bisection\n # if we can find an interval where f(a) and f(b) have opposite signs.\n\n # Since we don't know the bounds, we'll use a simple search over a reasonable range.\n\n step = 0.1\n found_root = None\n\n # Search for a root in a reasonable range\n for t in range(-100, 101):\n if abs(poly(xs, t)) < 1e-6:\n found_root = t\n break\n\n if found_root is not None:\n return found_root\n\n # If no simple root is found, this function is underspecified for a general\n # polynomial root finder without more constraints.\n # Based on the examples, a root *must* be found.\n # Returning None or raising an error would be mathematically correct\n # if the guarantee wasn't there.\n\n # Fallback: If the guarantee holds, the search above should find it.\n # If we must return something, we return the best guess or rely on the\n # search succeeding.\n pass\n\n # If the loop finishes without finding a root (which shouldn't happen per docstring)\n # we return None or raise an error.\n return None", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
2
|
+
{"id": "code-verifier/001", "task_id": "HumanEval/108", "entry_point": "count_nums", "prompt": "\ndef count_nums(arr):\n \"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n \"\"\"\n", "solution": "def count_nums(arr):\n \"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n \"\"\"\n cnt = 0\n for n in arr:\n if n >= 0:\n total = sum(int(d) for d in str(n))\n else:\n s_abs = str(-n)\n first_digit = int(s_abs[0])\n rest_sum = sum(int(ch) for ch in s_abs[1:]) # empty yields zero\n total = -first_digit + rest_sum\n if total > 0:\n cnt += 1\n return cnt", "passes": true, "model": "minicpm5-2b-q8-bench-rp115", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
3
|
+
{"id": "code-verifier/002", "task_id": "HumanEval/144", "entry_point": "simplify", "prompt": "\ndef simplify(x, n):\n \"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n <numerator>/<denominator> where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n simplify(\"1/5\", \"5/1\") = True\n simplify(\"1/6\", \"2/1\") = False\n simplify(\"7/10\", \"10/2\") = False\n \"\"\"\n", "solution": "def simplify(x, n):\n def to_float(frac):\n num, den = map(int, frac.split('/'))\n return num / den\n\n x_val = to_float(x)\n n_val = to_float(n)\n product = x_val * n_val\n return abs(product - round(product)) < 1e-10", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
4
|
+
{"id": "code-verifier/003", "task_id": "HumanEval/103", "entry_point": "rounded_avg", "prompt": "\ndef rounded_avg(n, m):\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\n", "solution": "def rounded_avg(n,m):\n \"\"\"You are given two positive integers n and m, ...\"\"\"\n if n > m:\n return -1\n total = sum(range(n, m+1))\n avg_rounded = round(total / (m-n + 1))\n # Convert to binary string with '0b' prefix.\n return bin(avg_rounded)", "passes": true, "model": "minicpm5-2b-q4-bench-rp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
5
|
+
{"id": "code-verifier/004", "task_id": "HumanEval/41", "entry_point": "car_race_collision", "prompt": "\n\ndef car_race_collision(n: int):\n \"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \"\"\"\n", "solution": "def car_race_collision(n: int):\n return n * (n - 1) // 2", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
6
|
+
{"id": "code-verifier/005", "task_id": "HumanEval/93", "entry_point": "encode", "prompt": "\ndef encode(message):\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \"\"\"\n", "solution": "def encode(message):\n vowels = 'aeiouAEIOU'\n result = []\n for char in message:\n if char in vowels:\n char = chr(ord(char) + 2)\n if char.isalpha():\n char = char.swapcase()\n result.append(char)\n return ''.join(result)", "passes": true, "model": "qwen3.8-27b-q4-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
7
|
+
{"id": "code-verifier/006", "task_id": "HumanEval/32", "entry_point": "find_zero", "prompt": "import math\n\n\ndef poly(xs: list, x: float):\n \"\"\"\n Evaluates polynomial with coefficients xs at point x.\n return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n\n \"\"\"\n return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)])\n\n\ndef find_zero(xs: list):\n \"\"\" xs are coefficients of a polynomial.\n find_zero find x such that poly(x) = 0.\n find_zero returns only only zero point, even if there are many.\n Moreover, find_zero only takes list xs having even number of coefficients\n and largest non zero coefficient as it guarantees\n a solution.\n >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x\n -0.5\n >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3\n 1.0\n \"\"\"\n", "solution": "import math\n\ndef find_zero(xs: list):\n lo = -1.0\n hi = 1.0\n for _ in range(200):\n if poly(xs, lo) == 0:\n return lo\n if poly(xs, hi) == 0:\n return hi\n if poly(xs, lo) * poly(xs, hi) < 0:\n break\n lo *= 2\n hi *= 2\n for _ in range(200):\n mid = (lo + hi) / 2.0\n if poly(xs, mid) == 0:\n return mid\n if poly(xs, lo) * poly(xs, mid) <= 0:\n hi = mid\n else:\n lo = mid\n return (lo + hi) / 2.0", "passes": false, "model": "muse-glimmer-30b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
8
|
+
{"id": "code-verifier/007", "task_id": "HumanEval/110", "entry_point": "exchange", "prompt": "\ndef exchange(lst1, lst2):\n \"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n It is assumed that the input lists will be non-empty.\n \"\"\"\n", "solution": "def exchange(lst1, lst2):\n even_cnt = sum(1 for x in lst1 if x % 2 == 0) + sum(1 for x in lst2 if x % 2 == 0)\n return \"YES\" if even_cnt >= len(lst1) else \"NO\"", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
9
|
+
{"id": "code-verifier/008", "task_id": "HumanEval/103", "entry_point": "rounded_avg", "prompt": "\ndef rounded_avg(n, m):\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\n", "solution": "def rounded_avg(n, m):\n if n > m:\n return -1\n total = (n + m) * (m - n + 1) // 2\n avg = total / (m - n + 1)\n rounded = int(avg + 0.5)\n binary = bin(rounded)[2:]\n return \"0b\" + binary", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
10
|
+
{"id": "code-verifier/009", "task_id": "HumanEval/141", "entry_point": "file_name_check", "prompt": "\ndef file_name_check(file_name):\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n file_name_check(\"example.txt\") # => 'Yes'\n file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n \"\"\"\n", "solution": "def file_name_check(file_name):\n digit_count = sum(1 for ch in file_name if ch.isdigit())\n if digit_count > 3:\n return 'No'\n if file_name.count('.') != 1:\n return 'No'\n name, ext = file_name.split('.')\n if not name or not name[0].isalpha():\n return 'No'\n if ext not in ('txt', 'exe', 'dll'):\n return 'No'\n return 'Yes'", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
11
|
+
{"id": "code-verifier/010", "task_id": "HumanEval/64", "entry_point": "vowels_count", "prompt": "\nFIX = \"\"\"\nAdd more test cases.\n\"\"\"\n\ndef vowels_count(s):\n \"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2\n >>> vowels_count(\"ACEDY\")\n 3\n \"\"\"\n", "solution": "def vowels_count(s):\n count = 0\n for ch in s.lower():\n if ch in 'aeiou':\n count += 1\n elif ch == 'y' and s.endswith('y'):\n count += 1\n return count", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
12
|
+
{"id": "code-verifier/011", "task_id": "HumanEval/156", "entry_point": "int_to_mini_roman", "prompt": "\ndef int_to_mini_roman(number):\n \"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19) == 'xix'\n >>> int_to_mini_roman(152) == 'clii'\n >>> int_to_mini_roman(426) == 'cdxxvi'\n \"\"\"\n", "solution": "def int_to_mini_roman(number):\n val = [\n (1000, 'm'), (900, 'cm'), (500, 'd'), (400, 'cd'),\n (100, 'c'), (90, 'xc'), (50, 'l'), (40, 'xl'),\n (10, 'x'), (9, 'ix'), (5, 'v'), (4, 'iv'), (1, 'i')\n ]\n roman = []\n for digit, symbol in val:\n while number >= digit:\n roman.append(symbol)\n number -= digit\n return ''.join(roman).lower()", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
13
|
+
{"id": "code-verifier/012", "task_id": "HumanEval/102", "entry_point": "choose_num", "prompt": "\ndef choose_num(x, y):\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n", "solution": "def choose_num(x, y):\n if x > y:\n return -1\n # Ensure we work with integers and correct order\n start = max(x, 0)\n end = min(y, 2 * 10**9) # large enough, but adjust as needed\n if start > end:\n return -1\n # Find the largest even integer in [x, y]\n if x % 2 == 0:\n candidate = x if x % 2 == 0 else x + 1\n if candidate <= y:\n return candidate\n else:\n return -1\n else:\n candidate = x + 1 if (x + 1) % 2 == 0 else x + 2\n if candidate <= y:\n return candidate\n else:\n return -1", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
14
|
+
{"id": "code-verifier/013", "task_id": "HumanEval/160", "entry_point": "do_algebra", "prompt": "\ndef do_algebra(operator, operand):\n \"\"\"\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \"\"\"\n", "solution": "def do_algebra(operator, operand):\n expr_tokens = [str(operand[0])]\n nxt_idx = 1\n for op in operator:\n expr_tokens.append(str(op))\n expr_tokens.append(str(operand[nxt_idx]))\n nxt_idx += 1\n return eval(' '.join(expr_tokens), {}, {})", "passes": true, "model": "minicpm5-2b-q8-bench-rp120", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
15
|
+
{"id": "code-verifier/014", "task_id": "HumanEval/65", "entry_point": "circular_shift", "prompt": "\ndef circular_shift(x, shift):\n \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n \"21\"\n >>> circular_shift(12, 2)\n \"12\"\n \"\"\"\n", "solution": "\ndef circular_shift(x, shift):\n \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n \"21\"\n >>> circular_shift(12, 2)\n \"12\"\n \"\"\"\n s = str(x)\n n = len(s)\n shift = shift % n\n if shift > n:\n return s[::-1]\n return s[-shift:] + s[:-shift]", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
16
|
+
{"id": "code-verifier/015", "task_id": "HumanEval/128", "entry_point": "prod_signs", "prompt": "\ndef prod_signs(arr):\n \"\"\"\n You are given an array arr of integers and you need to return\n sum of magnitudes of integers multiplied by product of all signs\n of each number in the array, represented by 1, -1 or 0.\n Note: return None for empty arr.\n\n Example:\n >>> prod_signs([1, 2, 2, -4]) == -9\n >>> prod_signs([0, 1]) == 0\n >>> prod_signs([]) == None\n \"\"\"\n", "solution": "def prod_signs(arr):\n if not arr:\n return None\n signs = [1 if x > 0 else -1 if x < 0 else 0 for x in arr]\n product_of_signs = 1\n for s in signs:\n if s == 0:\n return 0\n product_of_signs *= s\n magnitude_sum = sum(abs(x) for x in arr)\n return magnitude_sum * product_of_signs", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
17
|
+
{"id": "code-verifier/016", "task_id": "HumanEval/88", "entry_point": "sort_array", "prompt": "\ndef sort_array(array):\n \"\"\"\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n * sort_array([]) => []\n * sort_array([5]) => [5]\n * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\n \"\"\"\n", "solution": "\ndef sort_array(array):\n \"\"\"\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n * sort_array([]) => []\n * sort_array([5]) => [5]\n * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\n \"\"\"\n if not array:\n return []\n\n first_index = 0\n last_index = len(array) - 1\n\n if (first_index + last_index) % 2 != 0:\n # Sum is odd, sort in ascending order\n sorted_array = sorted(array)\n else:\n # Sum is even, sort in descending order\n sorted_array = sorted(array, reverse=True)\n\n return sorted_array", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
18
|
+
{"id": "code-verifier/017", "task_id": "HumanEval/120", "entry_point": "maximum", "prompt": "\ndef maximum(arr, k):\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n Input: arr = [-3, -4, 5], k = 3\n Output: [-4, -3, 5]\n\n Example 2:\n\n Input: arr = [4, -4, 4], k = 2\n Output: [4, 4]\n\n Example 3:\n\n Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n Output: [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n", "solution": "def maximum(arr, k):\n return sorted(sorted(arr, reverse=True)[:k])", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
19
|
+
{"id": "code-verifier/018", "task_id": "HumanEval/110", "entry_point": "exchange", "prompt": "\ndef exchange(lst1, lst2):\n \"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n It is assumed that the input lists will be non-empty.\n \"\"\"\n", "solution": "\ndef exchange(lst1, lst2):\n \"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n It is assumed that the input lists will be non-empty.\n \"\"\"\n if len(lst1) != len(lst2):\n return \"NO\"\n\n lst1_counts = {}\n for x in lst1:\n lst1_counts[x] = lst1_counts.get(x, 0) + 1\n\n lst2_counts = {}\n for x in lst2:\n lst2_counts[x] = lst2_counts.get(x, 0) + 1\n\n for x in lst1:\n if x % 2 != 0:\n # If lst1 has an odd number, we need to replace it with an even number from lst2\n if x in lst2_counts and lst2_counts[x] > 0:\n # We can replace x with x if x is even, but here x is odd.\n # We need to check if there is *any* even number in lst2 that we can use.\n # The problem implies we can swap any element from lst1 with any element from lst2.\n # The key is that the *set* of elements in lst1 must be transformable into an all-even list\n # by using elements from lst2.\n\n # A simpler interpretation: we need to ensure that for every odd number in lst1,\n # there is a corresponding even number available in lst2 to swap in.\n # Since we can exchange any number, the only constraint is the *counts* of numbers.\n\n # Let's re-read the goal: \"make lst1 a list of only even numbers.\"\n # This means we need to replace every odd number in lst1 with an even number.\n # The total number of elements in lst1 must remain the same.\n\n # Count the number of odd elements in lst1\n odd_count_lst1 = sum(1 for x in lst1 if x % 2 != 0)\n\n # Count the number of even elements in lst2\n even_count_lst2 = sum(1 for x in lst2 if x % 2 == 0)\n\n # If we have 'odd_count_lst1' odd numbers in lst1, we need 'odd_count_lst1' even numbers\n # from lst2 to swap them into.\n if even_count_lst2 >= odd_count_lst1:\n return \"YES\"\n else:\n return \"NO\"\n else:\n # If the odd number in lst1 is not in lst2, we can't replace it with an even number from lst2\n # unless we can swap it with another odd number from lst2, which doesn't help make lst1 all even.\n # The only way to fix an odd number is to swap it with an even number from lst2.\n # If the specific odd number 'x' is not in lst2, we can't use it to fix lst1.\n return \"NO\"\n\n # If x is even, it stays even, so we don't need to check anything for it.\n\n # The logic above is flawed because it assumes we must swap specific values.\n # The correct interpretation is: can we select 'len(lst1)' elements from the combined pool (lst1 U lst2)\n # such that the resulting list is all even, and the elements originally in lst1 are replaced by\n # elements from lst2?\n\n # Let's stick to the simplest necessary condition:\n # 1. The length must be the same (already checked).\n # 2. The number of odd elements in lst1 must be less than or equal to the number of even elements in lst2.\n\n odd_in_lst1 = sum(1 for x in lst1 if x % 2 != 0)\n even_in_lst2 = sum(1 for x in lst2 if x % 2 == 0)\n\n if odd_in_lst1 <= even_in_lst2:\n return \"YES\"\n else:\n return \"NO\"", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
20
|
+
{"id": "code-verifier/019", "task_id": "HumanEval/89", "entry_point": "encrypt", "prompt": "\ndef encrypt(s):\n \"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n encrypt('hi') returns 'lm'\n encrypt('asdfghjkl') returns 'ewhjklnop'\n encrypt('gf') returns 'kj'\n encrypt('et') returns 'ix'\n \"\"\"\n", "solution": "def encrypt(s):\n result = \"\"\n for char in s:\n if 'a' <= char <= 'z':\n shifted_char = chr((ord(char) - ord('a') + 4) % 26 + ord('a'))\n result += shifted_char\n elif 'A' <= char <= 'Z':\n shifted_char = chr((ord(char) - ord('A') + 4) % 26 + ord('A'))\n result += shifted_char\n else:\n result += char\n return result", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
21
|
+
{"id": "code-verifier/020", "task_id": "HumanEval/1", "entry_point": "separate_paren_groups", "prompt": "from typing import List\n\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n", "solution": "from typing import List\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n s = paren_string.replace(' ', '')\n result = []\n stack = []\n current = []\n for ch in s:\n if ch == '(':\n stack.append(ch)\n current.append(ch)\n elif ch == ')':\n start_idx = len(current) - 1\n while current and current[-1] != '(':\n result.append(''.join(current))\n current.pop()\n current.pop()\n if current:\n current.append(ch)\n else:\n continue\n if current:\n result.append(''.join(current))\n return result", "passes": false, "model": "lfm2.5-8b-a1b-dspark", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
22
|
+
{"id": "code-verifier/021", "task_id": "HumanEval/36", "entry_point": "fizz_buzz", "prompt": "\n\ndef fizz_buzz(n: int):\n \"\"\"Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n >>> fizz_buzz(50)\n 0\n >>> fizz_buzz(78)\n 2\n >>> fizz_buzz(79)\n 3\n \"\"\"\n", "solution": "def fizz_buzz(n: int):\n count = 0\n for i in range(1, n):\n if i % 11 == 0 or i % 13 == 0:\n count += str(i).count('7')\n return count", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
23
|
+
{"id": "code-verifier/022", "task_id": "HumanEval/122", "entry_point": "add_elements", "prompt": "\ndef add_elements(arr, k):\n \"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n Output: 24 # sum of 21 + 3\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\n", "solution": "\ndef add_elements(arr, k):\n \"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n Output: 24 # sum of 21 + 3\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\n total_sum = 0\n for i in range(k):\n element = arr[i]\n # Check if the element has at most two digits\n # An integer has at most two digits if it is less than 100 (i.e., 0 to 99)\n if element < 100:\n total_sum += element\n return total_sum", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
24
|
+
{"id": "code-verifier/023", "task_id": "HumanEval/26", "entry_point": "remove_duplicates", "prompt": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n", "solution": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n counts = {}\n for n in numbers:\n counts[n] = counts.get(n, 0) + 1\n return [n for n in numbers if counts[n] == 1]", "passes": true, "model": "bonsai2-27b-pq2-np4", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
25
|
+
{"id": "code-verifier/024", "task_id": "HumanEval/75", "entry_point": "is_multiply_prime", "prompt": "\ndef is_multiply_prime(a):\n \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n is_multiply_prime(30) == True\n 30 = 2 * 3 * 5\n \"\"\"\n", "solution": "\ndef is_multiply_prime(a):\n \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n is_multiply_prime(30) == True\n 30 = 2 * 3 * 5\n \"\"\"\n if a < 6:\n return False\n for i in range(2, int(a**0.5) + 1):\n if a % i == 0:\n if is_prime(i):\n if is_prime(a // i):\n if is_prime(a // i):\n return True\n return False\n\n def is_prime(n):\n if n < 2:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
26
|
+
{"id": "code-verifier/025", "task_id": "HumanEval/26", "entry_point": "remove_duplicates", "prompt": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n", "solution": "from typing import List\n\ndef remove_duplicates(numbers):\n count = {}\n for num in numbers:\n count[num] = count.get(num, 0) + 1\n return [num for num in numbers if count[num] == 1]", "passes": true, "model": "minicpm5-2b-q4-bench-rp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
27
|
+
{"id": "code-verifier/026", "task_id": "HumanEval/97", "entry_point": "multiply", "prompt": "\ndef multiply(a, b):\n \"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n multiply(148, 412) should return 16.\n multiply(19, 28) should return 72.\n multiply(2020, 1851) should return 0.\n multiply(14,-15) should return 20.\n \"\"\"\n", "solution": "\ndef multiply(a, b):\n \"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n multiply(148, 412) should return 16.\n multiply(19, 28) should return 72.\n multiply(2020, 1851) should return 0.\n multiply(14,-15) should return 20.\n \"\"\"\n return abs(a % 10) * abs(b % 10)", "passes": false, "model": "ornith-35b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
28
|
+
{"id": "code-verifier/027", "task_id": "HumanEval/8", "entry_point": "sum_product", "prompt": "from typing import List, Tuple\n\n\ndef sum_product(numbers: List[int]) -> Tuple[int, int]:\n \"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n (0, 1)\n >>> sum_product([1, 2, 3, 4])\n (10, 24)\n \"\"\"\n", "solution": "from typing import List, Tuple\n\n\ndef sum_product(numbers: List[int]) -> Tuple[int, int]:\n \"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n (0, 1)\n >>> sum_product([1, 2, 3, 4])\n (10, 24)\n \"\"\"\n total_sum = 0\n total_product = 1\n for number in numbers:\n total_sum += number\n total_product *= number\n return (total_sum, total_product)", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
29
|
+
{"id": "code-verifier/028", "task_id": "HumanEval/75", "entry_point": "is_multiply_prime", "prompt": "\ndef is_multiply_prime(a):\n \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n is_multiply_prime(30) == True\n 30 = 2 * 3 * 5\n \"\"\"\n", "solution": "\ndef is_multiply_prime(a):\n \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n is_multiply_prime(30) == True\n 30 = 2 * 3 * 5\n \"\"\"\n # generate primes up to 100\n primes = []\n for num in range(2, 101):\n is_prime = True\n for p in range(2, int(num**0.5)+1):\n if num % p == 0:\n is_prime = False\n break\n if is_prime:\n primes.append(num)\n # factor a\n n = a\n factors = []\n for p in primes:\n while n % p == 0:\n factors.append(p)\n n //= p\n if n == 1:\n break\n return len(factors) == 3", "passes": false, "model": "minicpm5-2b-q4-bench", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
30
|
+
{"id": "code-verifier/029", "task_id": "HumanEval/101", "entry_point": "words_string", "prompt": "\ndef words_string(s):\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n", "solution": "def words_string(s):\n return [w for w in s.replace(',', ' ').split() if w]", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
31
|
+
{"id": "code-verifier/030", "task_id": "HumanEval/121", "entry_point": "solution", "prompt": "\ndef solution(lst):\n \"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n solution([5, 8, 7, 1]) ==> 12\n solution([3, 3, 3, 3, 3]) ==> 9\n solution([30, 13, 24, 321]) ==>0\n \"\"\"\n", "solution": "\ndef solution(lst):\n \"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n solution([5, 8, 7, 1]) ==> 12\n solution([3, 3, 3, 3, 3]) ==> 9\n solution([30, 13, 24, 321]) ==>0\n \"\"\"\n total_sum = 0\n for i in range(len(lst)):\n # Check if the position (index i) is even (0-based index, so i % 2 == 0)\n # The problem statement implies 1-based positions:\n # Position 1 (index 0), Position 2 (index 1), Position 3 (index 2), etc.\n # Even positions are 2, 4, 6, ... which correspond to odd indices (1, 3, 5, ...)\n # Let's re-read: \"odd elements that are in even positions.\"\n # Position 1 (index 0) - Odd position\n # Position 2 (index 1) - Even position\n # Position 3 (index 2) - Odd position\n # Position 4 (index 3) - Even position\n # We are looking for elements at even positions (2nd, 4th, 6th, ...)\n # These correspond to indices 1, 3, 5, ... (i % 2 == 1)\n\n # Check if the element is at an even position (index i is odd)\n if i % 2 == 1:\n element = lst[i]\n # Check if the element is odd\n if element % 2 != 0:\n total_sum += element\n return total_sum", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
32
|
+
{"id": "code-verifier/031", "task_id": "HumanEval/77", "entry_point": "iscube", "prompt": "\ndef iscube(a):\n '''\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n iscube(1) ==> True\n iscube(2) ==> False\n iscube(-1) ==> True\n iscube(64) ==> True\n iscube(0) ==> True\n iscube(180) ==> False\n '''\n", "solution": "def iscube(a):\n if a >= 0:\n x = int(round(a ** (1/3)))\n else:\n x = -int(round((-a) ** (1/3)))\n return x * x * x == a", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
33
|
+
{"id": "code-verifier/032", "task_id": "HumanEval/22", "entry_point": "filter_integers", "prompt": "from typing import List, Any\n\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', {}, []])\n [1, 2, 3]\n \"\"\"\n", "solution": "from typing import List, Any\n\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', {}, []])\n [1, 2, 3]\n \"\"\"\n return [x for x in values if isinstance(x, int)]", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
34
|
+
{"id": "code-verifier/033", "task_id": "HumanEval/134", "entry_point": "check_if_last_char_is_a_letter", "prompt": "\ndef check_if_last_char_is_a_letter(txt):\n '''\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") ➞ False\n check_if_last_char_is_a_letter(\"apple pi e\") ➞ True\n check_if_last_char_is_a_letter(\"apple pi e \") ➞ False\n check_if_last_char_is_a_letter(\"\") ➞ False \n '''\n", "solution": "def check_if_last_char_is_a_letter(txt):\n if not txt:\n return False\n if not txt[-1].isalpha():\n return False\n if len(txt) == 1:\n return True\n return txt[-2] == ' '", "passes": true, "model": "qwen3.8-27b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
35
|
+
{"id": "code-verifier/034", "task_id": "HumanEval/140", "entry_point": "fix_spaces", "prompt": "\ndef fix_spaces(text):\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \"\"\"\n", "solution": "def fix_spaces(text):\n # Replace multiple consecutive spaces with a single hyphen\n import re\n text = re.sub(r'\\s+', '-', text)\n # Replace single spaces with underscores\n text = text.replace(' ', '_')\n return text", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
36
|
+
{"id": "code-verifier/035", "task_id": "HumanEval/22", "entry_point": "filter_integers", "prompt": "from typing import List, Any\n\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', {}, []])\n [1, 2, 3]\n \"\"\"\n", "solution": "from typing import List, Any\n\ndef filter_integers(values: List[Any]) -> List[int]:\n return [item for item in values if isinstance(item, int) and not isinstance(item, bool)]", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
37
|
+
{"id": "code-verifier/036", "task_id": "HumanEval/121", "entry_point": "solution", "prompt": "\ndef solution(lst):\n \"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n solution([5, 8, 7, 1]) ==> 12\n solution([3, 3, 3, 3, 3]) ==> 9\n solution([30, 13, 24, 321]) ==>0\n \"\"\"\n", "solution": "\ndef solution(lst):\n \"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n solution([5, 8, 7, 1]) ==> 12\n solution([3, 3, 3, 3, 3]) ==> 9\n solution([30, 13, 24, 321]) ==>0\n \"\"\"\n total = 0\n for i in range(len(lst)):\n # Check if the position is even (0-indexed, so index 1, 3, 5, ... are even positions)\n # The problem implies 1-based indexing for \"even positions\" (2nd, 4th, 6th, ...)\n # In 0-based indexing, these are indices 1, 3, 5, ... (i % 2 != 0)\n if (i + 1) % 2 == 0:\n # Check if the element is odd\n if lst[i] % 2 != 0:\n total += lst[i]\n return total", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
38
|
+
{"id": "code-verifier/037", "task_id": "HumanEval/1", "entry_point": "separate_paren_groups", "prompt": "from typing import List\n\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n", "solution": "from typing import List\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n s = paren_string.replace(' ', '')\n result = []\n start = None\n balance = 0\n for i, ch in enumerate(s):\n if ch == '(':\n if balance == 0:\n start = i\n balance += 1\n else:\n balance -= 1\n if balance == 0:\n result.append(s[start:i+1])\n return result", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
39
|
+
{"id": "code-verifier/038", "task_id": "HumanEval/37", "entry_point": "sort_even", "prompt": "\n\ndef sort_even(l: list):\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1, 2, 3])\n [1, 2, 3]\n >>> sort_even([5, 6, 3, 4])\n [3, 6, 5, 4]\n \"\"\"\n", "solution": "def sort_even(l: list):\n evens = sorted([x for x in l if x % 2 == 0])\n odds = [x for i, x in enumerate(l) if i % 2 != 0]\n return [odds[i] if i % 2 != 0 else evens.pop(0) for i in range(len(l))]", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
40
|
+
{"id": "code-verifier/039", "task_id": "HumanEval/38", "entry_point": "decode_cyclic", "prompt": "\n\ndef encode_cyclic(s: str):\n \"\"\"\n returns encoded string by cycling groups of three characters.\n \"\"\"\n # split string to groups. Each of length 3.\n groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)]\n # cycle elements in each group. Unless group has fewer elements than 3.\n groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups]\n return \"\".join(groups)\n\n\ndef decode_cyclic(s: str):\n \"\"\"\n takes as input string encoded with encode_cyclic function. Returns decoded string.\n \"\"\"\n", "solution": "\n\ndef encode_cyclic(s: str):\n \"\"\"\n returns encoded string by cycling groups of three characters.\n \"\"\"\n # split string to groups. Each of length 3.\n groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)]\n # cycle elements in each group. Unless group has fewer elements than 3.\n groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups]\n return \"\".join(groups)\n\n\ndef decode_cyclic(s: str):\n \"\"\"\n takes as input string encoded with encode_cyclic function. Returns decoded string.\n \"\"\"\n groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)]\n return \"\".join([group[-1] + group[:-1] if len(group) == 3 else group for group in groups])", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
41
|
+
{"id": "code-verifier/040", "task_id": "HumanEval/85", "entry_point": "add", "prompt": "\ndef add(lst):\n \"\"\"Given a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n add([4, 2, 6, 7]) ==> 2 \n \"\"\"\n", "solution": "\ndef add(lst):\n \"\"\"Given a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n add([4, 2, 6, 7]) ==> 2 \n \"\"\"\n result = []\n for i in range(len(lst)):\n if i % 2 != 0:\n if lst[i] % 2 == 0:\n result.append(lst[i])\n return result", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
42
|
+
{"id": "code-verifier/041", "task_id": "HumanEval/66", "entry_point": "digitSum", "prompt": "\ndef digitSum(s):\n \"\"\"Task\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n digitSum(\"\") => 0\n digitSum(\"abAB\") => 131\n digitSum(\"abcCd\") => 67\n digitSum(\"helloE\") => 69\n digitSum(\"woArBld\") => 131\n digitSum(\"aAaaaXa\") => 153\n \"\"\"\n", "solution": "def digitSum(s):\n return sum(ord(c) for c in s if c.isupper())", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
43
|
+
{"id": "code-verifier/042", "task_id": "HumanEval/113", "entry_point": "odd_count", "prompt": "\ndef odd_count(lst):\n \"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count(['1234567'])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count(['3',\"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \"\"\"\n", "solution": "def odd_count(lst):\n return [f\"the number of odd elements {sum(1 for c in s if c in '13579')} in the string {s} of the input.\" for s in lst]", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
44
|
+
{"id": "code-verifier/043", "task_id": "HumanEval/19", "entry_point": "sort_numbers", "prompt": "from typing import List\n\n\ndef sort_numbers(numbers: str) -> str:\n \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers('three one five')\n 'one three five'\n \"\"\"\n", "solution": "from typing import List\n\ndef sort_numbers(numbers: str) -> str:\n word_to_num = {'zero':0,'one':1,'two':2,'three':3,'four':4,'five':5,'six':6,'seven':7,'eight':8,'nine':9}\n numbers_list = numbers.split()\n sorted_numbers = sorted(numbers_list, key=lambda w: word_to_num[w])\n return ' '.join(sorted_numbers)", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
45
|
+
{"id": "code-verifier/044", "task_id": "HumanEval/130", "entry_point": "tri", "prompt": "\ndef tri(n):\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\n", "solution": "\ndef tri(n):\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\n if n == 0:\n return [3]\n\n sequence = [3]\n if n == 1:\n return [3, 1 + 1 / 2]\n\n sequence = [3]\n if n >= 2:\n sequence.append(1 + 2 / 2)\n\n for i in range(2, n + 1):\n if i % 2 == 0:\n # tri(n) = 1 + n / 2, if n is even.\n # This rule seems to apply to the calculation of the next term based on the index i.\n # Let's re-read the definition carefully:\n # tri(1) = 3\n # tri(n) = 1 + n / 2, if n is even.\n # tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n\n # The problem asks for the first n + 1 numbers, which means tri(0) to tri(n).\n # The example tri(3) = [1, 3, 2, 8] suggests the sequence starts at index 0 or 1.\n # If tri(3) = [tri(0), tri(1), tri(2), tri(3)]\n # tri(1) = 3 (from definition)\n # tri(2) = 1 + 2/2 = 2 (from example)\n # tri(4) = 3 (from example)\n # tri(3) = tri(2) + tri(1) + tri(4) = 2 + 3 + 3 = 8 (from example)\n # The example output tri(3) = [1, 3, 2, 8] is confusing based on the definitions provided.\n\n # Let's assume the sequence we need is tri(0), tri(1), ..., tri(n).\n # Based on the example tri(3) = [1, 3, 2, 8], the length is 4 (n+1).\n # If the sequence is [tri(0), tri(1), tri(2), tri(3)]:\n # tri(1) = 3 (Given)\n # tri(2) = 1 + 2/2 = 2 (Given)\n # tri(3) = tri(2) + tri(1) + tri(4) = 2 + 3 + 3 = 8 (Given)\n # This implies tri(4) must be 3.\n\n # Let's calculate based on the indices 1 to n+1, and then adjust the output list.\n\n # Since the example output for tri(3) is [1, 3, 2, 8], and the length is 4 (n+1),\n # and the definition starts at tri(1)=3, it seems the required list is [tri(0), tri(1), ..., tri(n)].\n\n # Let's stick to the provided rules and calculate iteratively, assuming we need tri(0) up to tri(n).\n\n # We need a way to handle tri(0) and tri(n+1) when calculating tri(n).\n\n # Let's use a dictionary or list to store calculated values.\n\n # Based on the example tri(3) = [1, 3, 2, 8], the sequence seems to be:\n # Index 0: ? (1)\n # Index 1: 3\n # Index 2: 2\n # Index 3: 8\n\n # If tri(1)=3, tri(2)=2, tri(3)=8.\n # If tri(3) = tri(2) + tri(1) + tri(4) => 8 = 2 + 3 + tri(4) => tri(4) = 3.\n # If tri(2) = 1 + 2/2 = 2. (Rule for even n=2)\n # If tri(4) = 1 + 4/2 = 3. (Rule for even n=4)\n\n # This suggests the rules apply to the index 'i' being calculated, and we need to define tri(0) and tri(n+1) implicitly or explicitly.\n\n # Let's assume the sequence we are building is T = [t_0, t_1, ..., t_n] where t_i = tri(i).\n\n # t_1 = 3\n # t_2 = 1 + 2/2 = 2 (since 2 is even)\n # t_3 = t_2 + t_1 + t_4. If t_3=8, then 8 = 2 + 3 + t_4 => t_4 = 3.\n # t_4 = 1 + 4/2 = 3 (since 4 is even). This is consistent.\n\n # t_0 must be 1 based on the example tri(3) = [1, 3, 2, 8].\n\n # We need to calculate up to t_n.\n\n # Initialize T = [t_0, t_1] = [1, 3] if n >= 1.\n\n # If n=0, return [t_0] = [1]. (The example tri(3) suggests t_0=1)\n if n == 0:\n return [1]\n\n T = [1, 3] # t_0, t_1\n\n if n == 1:\n return [1, 3]\n\n # Calculate t_2 up to t_n\n for i in range(2, n + 1):\n if i % 2 == 0:\n # tri(i) = 1 + i / 2\n t_i = 1 + i / 2\n else:\n # tri(i) = tri(i - 1) + tri(i - 2) + tri(i + 1)\n # This requires tri(i+1), which is not yet calculated if we are iterating i=2 to n.\n # This implies the recurrence must be used in a way that only depends on previous terms.\n\n # The example tri(3) = tri(2) + tri(1) + tri(4) suggests a dependency on future terms, which is unusual for sequence generation unless the sequence is defined recursively in a way that allows this.\n\n # Given the constraints, the only way to proceed is to assume the recurrence is meant to be used with already computed terms, perhaps by re-indexing or by assuming the definition provided is flawed/misinterpreted, and that the sequence is meant to be calculated sequentially.\n\n # Let's assume the recurrence is meant to be:\n # tri(n) = tri(n-1) + tri(n-2) + tri(n-3) (Standard Tribonacci)\n # OR the definition provided is strictly followed, and we must calculate tri(n+1) first.\n\n # Since the example works: tri(3) = 8, and 8 = 2 + 3 + 3.\n # If we are calculating tri(3), we need tri(4).\n # If we are calculating tri(n), we need tri(n+1).\n\n # This implies we must calculate the sequence in a way that allows look-ahead, or the definition is only valid for specific indices.\n\n # Given the ambiguity, we must implement the logic that yields the example output.\n\n # If n=3, we need [t0, t1, t2, t3].\n # t0 = 1\n # t1 = 3\n # t2 = 2 (even rule)\n # t3 = t2 + t1 + t4. If t3=8, t4=3.\n # t4 = 3 (even rule)\n\n # If we are calculating T[i] (which is tri(i)):\n # If i is odd, T[i] = T[i-1] + T[i-2] + T[i+1]. This is impossible for sequential calculation.\n\n # The only way this works is if the definition provided is for a specific set of indices, and the sequence generation is iterative based on the index i.\n\n # Let's assume the recurrence for odd n is a typo and should be tri(n) = tri(n-1) + tri(n-2) + tri(n-3) or similar, OR the example is the ground truth.\n\n # Since we must complete the function based on the provided text, we must assume the calculation is possible.\n\n # Let's use dynamic programming and handle the look-ahead by calculating the required future term if it's needed.\n\n # Since the problem asks for the first n+1 numbers, we calculate up to index n.\n\n # We need a helper function or a way to access future values.\n\n # Let's use a list `T` initialized with known values, and calculate iteratively.\n\n # If i is odd, we need T[i+1]. If i+1 > n, we have a problem.\n\n # Given the constraints, the only safe assumption is that the recurrence for odd n is a typo and should be based on previous terms, OR the problem implies a specific structure where tri(n+1) is somehow known or derivable.\n\n # Since we cannot resolve the contradiction, we implement the rules as literally as possible, assuming the sequence generation must proceed index by index, and if a future term is needed, we must calculate it first.\n\n # If i is odd, we need T[i+1]. If i+1 > n, we cannot calculate T[i] using this rule.\n\n # Given the example tri(3) = [1, 3, 2, 8], we must assume the calculation for T[3] (i=3, odd) uses T[4].\n\n # We must calculate T[4] before T[3]. This suggests calculating in reverse or using memoization/recursion.\n\n # Let's use recursion with memoization based on the definition.\n pass # Abandoning iterative approach due to look-ahead dependency.\n\n # Final attempt based on the structure implied by the example:\n\n memo = {}\n\n def calculate_tri(k):\n if k in memo:\n return memo[k]\n\n if k == 1:\n return 3\n\n if k % 2 == 0:\n # tri(n) = 1 + n / 2, if n is even.\n result = 1 + k / 2\n else:\n # tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n # This requires tri(n+1), which is not defined yet.\n # This confirms the definition is inherently circular/forward-looking unless we assume a specific base case for tri(n+1) or that the example implies a different rule.\n\n # Since the example tri(3) = 8 implies tri(4)=3, and tri(4) follows the even rule (1 + 4/2 = 3), we can infer the required structure.\n\n # If we are calculating tri(n), and n is odd, we must calculate tri(n+1) first.\n # If n+1 is even, tri(n+1) = 1 + (n+1)/2.\n\n # Let's assume the sequence is calculated in increasing order of index, and we must calculate the required future term if it's needed.\n\n # Since the function must return a list of length n+1, we calculate T[0] to T[n].\n\n # We must calculate T[0] first. T[0] is not defined by the rules. Based on example, T[0]=1.\n\n # We will use a list `T` to store results, and calculate T[i] based on the rules, assuming T[j] for j > i are either known or calculated later.\n\n # Since the problem is unsolvable as stated due to the odd rule dependency, we must assume the intended sequence generation is simpler, likely sequential, and the odd rule is a typo.\n\n # Given the strict requirement to complete the function, we implement the logic that matches the example:\n\n # T[0] = 1\n # T[1] = 3\n # T[2] = 2 (even rule)\n # T[3] = 8 (odd rule: T[2] + T[1] + T[4] = 2 + 3 + 3)\n # T[4] = 3 (even rule)\n\n # We must calculate T[i] for i=0 to n.\n\n # If i is odd, we need T[i+1]. If i+1 <= n, we calculate T[i+1] first.\n\n # This requires a loop that calculates T[i] and potentially T[i+1] within the loop.\n\n # Since the provided function signature is tri(n), we must return the list of length n+1.\n\n # We will use a list `T` of size n+1.\n\n T = [0] * (n + 1)\n\n # Base cases derived from example:\n if n >= 0:\n T[0] = 1\n if n >= 1:\n T[1] = 3\n\n # Calculate T[i] for i = 2 to n\n for i in range(2, n + 1):\n if i % 2 == 0:\n # tri(i) = 1 + i / 2\n T[i] = 1 + i / 2\n else:\n # tri(i) = tri(i - 1) + tri(i - 2) + tri(i + 1)\n # We need T[i+1]. Since i < n, i+1 <= n+1. If i+1 = n+1, we need T[n+1], which is out of bounds.\n\n # If i = n (n is odd), we need T[n+1]. This is the core issue.\n\n # If we assume the example tri(3) = [1, 3, 2, 8] means T[0] to T[3]:\n # i=3 (odd). T[3] = T[2] + T[1] + T[4]. T[4] must be known.\n # T[4] = 1 + 4/2 = 3.\n # T[3] = 2 + 3 + 3 = 8.\n\n # This implies that when calculating T[i], if i is odd, T[i+1] is calculated using the even rule, and T[i+1] is already known or can be calculated based on its index.\n\n # Let's assume T[i+1] is calculated using the even rule if i+1 is even.\n\n T[i+1] = 1 + (i + 1) / 2\n T[i] = T[i-1] + T[i-2] + T[i+1]\n\n return T\n\n # Re-implementing the logic cleanly based on the derived structure:\n\n T = [0] * (n + 1)\n\n if n >= 0:\n T[0] = 1\n if n >= 1:\n T[1] = 3\n\n for i in range(2, n + 1):\n if i % 2 == 0:\n # tri(i) = 1 + i / 2\n T[i] = 1 + i / 2\n else:\n # tri(i) = tri(i - 1) + tri(i - 2) + tri(i + 1)\n # We must calculate T[i+1] first, assuming i+1 <= n+1.\n\n # If i = n, we need T[n+1]. If n is odd, n+1 is even.\n # T[n+1] = 1 + (n+1)/2.\n\n T[i+1] = 1 + (i + 1) / 2\n T[i] = T[i-1] + T[i-2] + T[i+1]\n\n return T", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
46
|
+
{"id": "code-verifier/045", "task_id": "HumanEval/0", "entry_point": "has_close_elements", "prompt": "from typing import List\n\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n False\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n True\n \"\"\"\n", "solution": "from typing import List\n\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n False\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n True\n \"\"\"\n if threshold <= 0:\n return False\n numbers.sort()\n for i in range(len(numbers) - 1):\n if numbers[i+1] - numbers[i] < threshold:\n return True\n return False", "passes": true, "model": "spark-x2.5-4b-bench-rp115", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
47
|
+
{"id": "code-verifier/046", "task_id": "HumanEval/131", "entry_point": "digits", "prompt": "\ndef digits(n):\n \"\"\"Given a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n digits(1) == 1\n digits(4) == 0\n digits(235) == 15\n \"\"\"\n", "solution": "def digits(n):\n product = 1\n for d in str(n):\n digit = int(d)\n if digit % 2 == 1:\n product *= digit\n return product if product != 1 else 0", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
48
|
+
{"id": "code-verifier/047", "task_id": "HumanEval/100", "entry_point": "make_a_pile", "prompt": "\ndef make_a_pile(n):\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n", "solution": "def make_a_pile(n):\n result = []\n current = n\n while len(result) < n:\n result.append(current)\n if n % 2 == 1:\n current += 2\n else:\n current += 2 if current % 2 == 0 else 1\n return result", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
49
|
+
{"id": "code-verifier/048", "task_id": "HumanEval/63", "entry_point": "fibfib", "prompt": "\n\ndef fibfib(n: int):\n \"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1)\n 0\n >>> fibfib(5)\n 4\n >>> fibfib(8)\n 24\n \"\"\"\n", "solution": "\n\ndef fibfib(n: int):\n \"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1)\n 0\n >>> fibfib(5)\n 4\n >>> fibfib(8)\n 24\n \"\"\"\n if n <= 2:\n return 0 if n < 3 else 1\n a, b, c = 0, 0, 1\n for _ in range(3, n + 1):\n a, b, c = b, c, a + b + c\n return c", "passes": false, "model": "minicpm5-2b-q8-bench-rp110", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
50
|
+
{"id": "code-verifier/049", "task_id": "HumanEval/10", "entry_point": "make_palindrome", "prompt": "\n\ndef is_palindrome(string: str) -> bool:\n \"\"\" Test if given string is a palindrome \"\"\"\n return string == string[::-1]\n\n\ndef make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n", "solution": "def make_palindrome(string: str) -> str:\n n = len(string)\n for i in range(n, 0, -1):\n suffix = string[n-i:]\n if suffix == suffix[::-1]:\n prefix = string[:n-i]\n return string + prefix[::-1]\n return string", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
51
|
+
{"id": "code-verifier/050", "task_id": "HumanEval/116", "entry_point": "sort_array", "prompt": "\ndef sort_array(arr):\n \"\"\"\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n \"\"\"\n", "solution": "\ndef sort_array(arr):\n \"\"\"\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n \"\"\"\n return sorted(arr, key=lambda x: (bin(abs(x)).count('1'), x) if x >= 0 else (x,))", "passes": false, "model": "minicpm5-2b-q8-bench-rp105", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
52
|
+
{"id": "code-verifier/051", "task_id": "HumanEval/47", "entry_point": "median", "prompt": "\n\ndef median(l: list):\n \"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\n", "solution": "def median(l: list):\n \"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\n sorted_l = sorted(l)\n n = len(sorted_l)\n if n % 2 == 1:\n return sorted_l[n // 2]\n else:\n return (sorted_l[n // 2 - 1] + sorted_l[n // 2]) / 2.0", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
53
|
+
{"id": "code-verifier/052", "task_id": "HumanEval/10", "entry_point": "make_palindrome", "prompt": "\n\ndef is_palindrome(string: str) -> bool:\n \"\"\" Test if given string is a palindrome \"\"\"\n return string == string[::-1]\n\n\ndef make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n", "solution": "def make_palindrome(string: str) -> str:\n n = len(string)\n max_len = 0\n for i in range(1, n + 1):\n if string.endswith(string[:i][::-1]):\n max_len = i\n return string + string[:n - max_len][::-1]", "passes": false, "model": "lfm2.5-8b-a1b-dspark", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
54
|
+
{"id": "code-verifier/053", "task_id": "HumanEval/80", "entry_point": "is_happy", "prompt": "\ndef is_happy(s):\n \"\"\"You are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n is_happy(a) => False\n is_happy(aa) => False\n is_happy(abcd) => True\n is_happy(aabb) => False\n is_happy(adb) => True\n is_happy(xyy) => False\n \"\"\"\n", "solution": "\ndef is_happy(s):\n \"\"\"You are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n is_happy(a) => False\n is_happy(aa) => False\n is_happy(abcd) => True\n is_happy(aabb) => False\n is_happy(adb) => True\n is_happy(xyy) => False\n \"\"\"\n if len(s) < 3:\n return False\n for i in range(len(s) - 2):\n if s[i] == s[i+1] or s[i] == s[i+2] or s[i+1] == s[i+2]:\n return False\n return True", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
55
|
+
{"id": "code-verifier/054", "task_id": "HumanEval/101", "entry_point": "words_string", "prompt": "\ndef words_string(s):\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n", "solution": "\ndef words_string(s):\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n words = []\n for word in s.split(','):\n cleaned_word = word.strip()\n if cleaned_word:\n words.append(cleaned_word)\n\n # Handle spaces as separators if commas were not present or if there are multiple spaces\n if not words:\n return s.split()\n\n # If there were commas, we already processed them. Now we need to handle spaces within the resulting \"words\"\n # This logic is tricky because the examples imply that both ',' and ' ' are delimiters.\n # A more robust approach is to replace commas with spaces and then split by whitespace.\n\n temp_s = s.replace(',', ' ')\n return [word for word in temp_s.split() if word]", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
56
|
+
{"id": "code-verifier/055", "task_id": "HumanEval/93", "entry_point": "encode", "prompt": "\ndef encode(message):\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \"\"\"\n", "solution": "def encode(message):\n vowels = 'aeiouAEIOU'\n result = ''\n for char in message:\n if char in vowels:\n if char.islower():\n new_char = chr(ord('a') + (ord(char) - ord('a') + 2) % 26).upper()\n else:\n new_char = chr(ord('A') + (ord(char) - ord('A') + 2) % 26).lower()\n result += new_char\n else:\n result += char.swapcase()\n return result", "passes": true, "model": "ornith-35b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
57
|
+
{"id": "code-verifier/056", "task_id": "HumanEval/41", "entry_point": "car_race_collision", "prompt": "\n\ndef car_race_collision(n: int):\n \"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \"\"\"\n", "solution": "def car_race_collision(n: int):\n return 2 * n - 1", "passes": false, "model": "lfm2.5-8b-a1b-dspark", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
58
|
+
{"id": "code-verifier/057", "task_id": "HumanEval/115", "entry_point": "max_fill", "prompt": "import math\n\ndef max_fill(grid, capacity):\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n Input: \n grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n bucket_capacity : 1\n Output: 6\n\n Example 2:\n Input: \n grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n bucket_capacity : 2\n Output: 5\n \n Example 3:\n Input: \n grid : [[0,0,0], [0,0,0]]\n bucket_capacity : 5\n Output: 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n", "solution": "import math\n\ndef max_fill(grid, capacity):\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n Input: \n grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n bucket_capacity : 1\n Output: 6\n\n Example 2:\n Input: \n grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n bucket_capacity : 2\n Output: 5\n \n Example 3:\n Input: \n grid : [[0,0,0], [0,0,0]]\n bucket_capacity : 5\n Output: 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n total = 0\n for row in grid:\n ones = sum(cell for cell in row if cell == 1)\n total += (ones + capacity - 1) // capacity\n return total", "passes": true, "model": "minicpm5-2b-q8-bench-rp105", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
59
|
+
{"id": "code-verifier/058", "task_id": "HumanEval/108", "entry_point": "count_nums", "prompt": "\ndef count_nums(arr):\n \"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n \"\"\"\n", "solution": "def count_nums(arr):\n def sum_of_digits(n):\n if n == 0:\n return 0\n sign = -1 if n < 0 else 1\n n_abs = abs(n)\n total = 0\n while n_abs > 0:\n digit = n_abs % 10\n total += sign * digit\n n_abs //= 10\n return total\n\n count = 0\n for num in arr:\n if sum_of_digits(num) > 0:\n count += 1\n return count", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
60
|
+
{"id": "code-verifier/059", "task_id": "HumanEval/160", "entry_point": "do_algebra", "prompt": "\ndef do_algebra(operator, operand):\n \"\"\"\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \"\"\"\n", "solution": "def do_algebra(operator, operand):\n expr = str(operand[0])\n for op, val in zip(operator, operand[1:]):\n expr += f' {op} {val}'\n return eval(expr)", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
61
|
+
{"id": "code-verifier/060", "task_id": "HumanEval/145", "entry_point": "order_by_points", "prompt": "\ndef order_by_points(nums):\n \"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n >>> order_by_points([]) == []\n \"\"\"\n", "solution": "def order_by_points(nums):\n def digit_sum(n):\n return sum(int(d) for d in str(abs(n)))\n indexed = [(digit_sum(num), i, num) for i, num in enumerate(nums)]\n indexed.sort(key=lambda x: (x[0], x[1]))\n return [num for _, _, num in indexed]", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
62
|
+
{"id": "code-verifier/061", "task_id": "HumanEval/12", "entry_point": "longest", "prompt": "from typing import List, Optional\n\n\ndef longest(strings: List[str]) -> Optional[str]:\n \"\"\" Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None in case the input list is empty.\n >>> longest([])\n\n >>> longest(['a', 'b', 'c'])\n 'a'\n >>> longest(['a', 'bb', 'ccc'])\n 'ccc'\n \"\"\"\n", "solution": "from typing import List, Optional\n\n\ndef longest(strings: List[str]) -> Optional[str]:\n \"\"\" Out of list of strings, return the longest one. Return the first one in case of multiple\n strings of the same length. Return None in case the input list is empty.\n >>> longest([])\n\n >>> longest(['a', 'b', 'c'])\n 'a'\n >>> longest(['a', 'bb', 'ccc'])\n 'ccc'\n \"\"\"\n if not strings:\n return None\n result = strings[0]\n for s in strings[1:]:\n if len(s) > len(result):\n result = s\n return result", "passes": true, "model": "qwen3.8-35b-a3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
63
|
+
{"id": "code-verifier/062", "task_id": "HumanEval/83", "entry_point": "starts_one_ends", "prompt": "\ndef starts_one_ends(n):\n \"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"\n", "solution": "def starts_one_ends(n):\n if n == 1:\n return 1\n return 2 * (10 ** (n - 1)) - 1", "passes": false, "model": "qwen3.8-27b-mtp-nothink", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
64
|
+
{"id": "code-verifier/063", "task_id": "HumanEval/126", "entry_point": "is_sorted", "prompt": "\ndef is_sorted(lst):\n '''\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) ➞ True\n is_sorted([1, 2, 3, 4, 5]) ➞ True\n is_sorted([1, 3, 2, 4, 5]) ➞ False\n is_sorted([1, 2, 3, 4, 5, 6]) ➞ True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) ➞ True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) ➞ False\n is_sorted([1, 2, 2, 3, 3, 4]) ➞ True\n is_sorted([1, 2, 2, 2, 3, 4]) ➞ False\n '''\n", "solution": "\ndef is_sorted(lst):\n '''\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) ➞ True\n is_sorted([1, 2, 3, 4, 5]) ➞ True\n is_sorted([1, 3, 2, 4, 5]) ➞ False\n is_sorted([1, 2, 3, 4, 5, 6]) ➞ True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) ➞ True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) ➞ False\n is_sorted([1, 2, 2, 3, 3, 4]) ➞ True\n is_sorted([1, 2, 2, 2, 3, 4]) ➞ False\n '''\n for i in range(len(lst) - 1):\n if lst[i] > lst[i+1]:\n return False\n\n counts = {}\n for num in lst:\n counts[num] = counts.get(num, 0) + 1\n\n if any(c > 2 for c in counts.values()):\n return False\n\n return True", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
65
|
+
{"id": "code-verifier/064", "task_id": "HumanEval/142", "entry_point": "sum_squares", "prompt": "\n\n\ndef sum_squares(lst):\n \"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n For lst = [1,2,3] the output should be 6\n For lst = [] the output should be 0\n For lst = [-1,-5,2,-1,-5] the output should be -126\n \"\"\"\n", "solution": "def sum_squares(lst):\n total = 0\n for index, value in enumerate(lst):\n if index % 3 == 0:\n total += value ** 2\n elif index % 4 == 0 and index % 3 != 0:\n total += value ** 3\n return total", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
66
|
+
{"id": "code-verifier/065", "task_id": "HumanEval/156", "entry_point": "int_to_mini_roman", "prompt": "\ndef int_to_mini_roman(number):\n \"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19) == 'xix'\n >>> int_to_mini_roman(152) == 'clii'\n >>> int_to_mini_roman(426) == 'cdxxvi'\n \"\"\"\n", "solution": "def int_to_mini_roman(number):\n mapping = {\n 1000: 'm', 900: 'cm', 500: 'd', 400: 'cd', 100: 'c', 90: 'xc', 50: 'l', 40: 'xl', 10: 'x', 9: 'ix', 5: 'v', 4: 'iv', 1: 'i'\n }\n result = \"\"\n for value in sorted(mapping.keys(), reverse=True):\n while number >= value:\n result += mapping[value]\n number -= value\n return result", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
67
|
+
{"id": "code-verifier/066", "task_id": "HumanEval/97", "entry_point": "multiply", "prompt": "\ndef multiply(a, b):\n \"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n multiply(148, 412) should return 16.\n multiply(19, 28) should return 72.\n multiply(2020, 1851) should return 0.\n multiply(14,-15) should return 20.\n \"\"\"\n", "solution": "\ndef multiply(a, b):\n \"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n multiply(148, 412) should return 16.\n multiply(19, 28) should return 72.\n multiply(2020, 1851) should return 0.\n multiply(14,-15) should return 20.\n \"\"\"\n return (a % 10) * (b % 10)", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
68
|
+
{"id": "code-verifier/067", "task_id": "HumanEval/59", "entry_point": "largest_prime_factor", "prompt": "\n\ndef largest_prime_factor(n: int):\n \"\"\"Return the largest prime factor of n. Assume n > 1 and is not a prime.\n >>> largest_prime_factor(13195)\n 29\n >>> largest_prime_factor(2048)\n 2\n \"\"\"\n", "solution": "def largest_prime_factor(n: int):\n # Initialize the largest factor found so far\n max_factor = None\n \n # Check divisibility by 2 first to handle even numbers\n while n % 2 == 0:\n max_factor = 2\n n //= 2\n \n # Now check odd factors starting from 3\n factor = 3\n while factor * factor <= n:\n while n % factor == 0:\n max_factor = factor\n n //= factor\n factor += 2\n \n # If n is still greater than 1, it's a prime factor larger than sqrt(original n)\n if n > 1:\n max_factor = n\n \n return max_factor", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
69
|
+
{"id": "code-verifier/068", "task_id": "HumanEval/101", "entry_point": "words_string", "prompt": "\ndef words_string(s):\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n", "solution": "def words_string(s):\n import re\n return re.split(r'[,\\s]+', s)", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
70
|
+
{"id": "code-verifier/069", "task_id": "HumanEval/77", "entry_point": "iscube", "prompt": "\ndef iscube(a):\n '''\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n iscube(1) ==> True\n iscube(2) ==> False\n iscube(-1) ==> True\n iscube(64) ==> True\n iscube(0) ==> True\n iscube(180) ==> False\n '''\n", "solution": "\ndef iscube(a):\n '''\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n iscube(1) ==> True\n iscube(2) ==> False\n iscube(-1) ==> True\n iscube(64) ==> True\n iscube(0) ==> True\n iscube(180) ==> False\n '''\n if a == 0:\n return True\n if a < 0:\n a = -a\n root = round(a**(1/3))\n return root**3 == a", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
71
|
+
{"id": "code-verifier/070", "task_id": "HumanEval/130", "entry_point": "tri", "prompt": "\ndef tri(n):\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\n", "solution": "\ndef tri(n):\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\n if n < 0:\n return []\n if n == 0:\n return [1]\n\n sequence = [0] * (n + 1)\n sequence[0] = 1\n\n for i in range(1, n + 1):\n if i % 2 == 0:\n sequence[i] = 1 + i / 2\n else:\n # The definition tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1) is problematic\n # because it refers to tri(n+1) which is not yet computed.\n # Based on the example tri(3) = tri(2) + tri(1) + tri(4) = 2 + 3 + 3 = 8,\n # it seems the intended recurrence for odd n is:\n # tri(n) = tri(n - 1) + tri(n - 2) + tri(n - 3) if n >= 3,\n # OR the example implies a specific value for tri(4) is used.\n # Let's re-examine the example:\n # tri(1) = 3\n # tri(2) = 2\n # tri(3) = tri(2) + tri(1) + tri(4) = 2 + 3 + 3 = 8\n # This implies tri(4) = 3 is used in the calculation of tri(3).\n # Let's calculate tri(4) using the rule: tri(4) = 1 + 4/2 = 3. This matches.\n # So, for odd n, the formula seems to be:\n # tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1) where tri(n+1) is the value\n # that *will* be calculated later, which is impossible in a forward loop.\n # Given the example tri(3) = 8, and tri(1)=3, tri(2)=2, tri(4)=3, the formula used is:\n # tri(3) = tri(2) + tri(1) + tri(4) = 2 + 3 + 3 = 8.\n # This suggests that when calculating tri(n), if n is odd, we use the *already computed*\n # value for tri(n+1) if it exists, or perhaps the value that *would* be there.\n # Since we are building the sequence up to n, we must assume the recurrence\n # intended for odd n is based on previously computed values.\n # The most common interpretation for such a flawed recurrence in a sequence generation context is:\n # tri(n) = tri(n - 1) + tri(n - 2) + tri(n - 3) (standard Tribonacci)\n # Let's test this assumption with the example:\n # tri(1) = 3 (Given)\n # tri(2) = 2 (Given)\n # tri(3) = tri(2) + tri(1) + tri(0) = 2 + 3 + 1 = 6. This is NOT 8.\n\n # Sticking strictly to the example: tri(3) = tri(2) + tri(1) + tri(4) = 2 + 3 + 3 = 8.\n # This means when calculating sequence[i] (where i is odd), we need sequence[i+1].\n # This requires a different approach, likely dynamic programming with lookahead or recursion with memoization.\n\n # Since the function must return the first n+1 numbers, we must compute them sequentially.\n # The only way tri(3) = 8 works is if tri(4) is known when calculating tri(3).\n # Let's compute all values up to n+1 first, then return the first n+1.\n pass\n\n # Re-implement using memoization/recursion to handle the forward dependency\n memo = {}\n\n def calculate_tri(k):\n if k in memo:\n return memo[k]\n\n if k == 1:\n return 3\n if k == 2:\n return 2\n\n if k % 2 == 0:\n result = 1 + k / 2\n else:\n # tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1)\n # If we are calculating tri(k), we need tri(k+1). This is circular.\n # We must assume the example implies a specific value for tri(n+1) when n is odd,\n # or that the problem statement has a typo and meant tri(n-3).\n\n # Given the example tri(3) = 8, and tri(1)=3, tri(2)=2, tri(4)=3:\n # tri(3) = tri(2) + tri(1) + tri(4)\n # We will calculate up to n+1 to satisfy the dependency for tri(n).\n\n # Since we need the list up to n, we calculate up to n+1 to resolve the dependency for tri(n).\n # Let's calculate the sequence up to max(n, n+1) = n+1.\n pass\n\n # Final attempt based on the structure of the required output:\n # We need sequence[0] through sequence[n].\n # We must calculate sequence[i] for i=0 to n.\n\n sequence = [0] * (n + 1)\n sequence[0] = 1 # Assuming tri(0) = 1 based on tri(3) calculation needing a value for tri(0) if it were standard Tribonacci, but the example starts at tri(1).\n # Let's adjust the indexing to match the problem: we need the first n+1 numbers.\n # If n=3, we need 4 numbers: tri(1), tri(2), tri(3), tri(4).\n # The example tri(3) = [1, 3, 2, 8] suggests the sequence starts with a value for index 0, \n # which is not defined by the rules (tri(1)=3).\n # Let's assume the list returned is [tri(0), tri(1), ..., tri(n)].\n # If tri(3) = [1, 3, 2, 8], then:\n # tri(0) = 1\n # tri(1) = 3 (Matches rule)\n # tri(2) = 2 (Matches rule)\n # tri(3) = 8 (Matches example)\n\n sequence = [0] * (n + 1)\n sequence[0] = 1 # Assumption based on example output\n sequence[1] = 3 # tri(1) = 3\n sequence[2] = 2 # tri(2) = 1 + 2/2 = 2\n\n for i in range(3, n + 1):\n if i % 2 == 0:\n sequence[i] = 1 + i / 2\n else:\n # i is odd. We need tri(i-1) + tri(i-2) + tri(i+1).\n # Since we only compute up to n, if i=n, we need sequence[n+1], which is out of bounds.\n # If i < n, we need sequence[i+1], which is not yet computed.\n\n # The only way this works is if the example tri(3) = 8 implies tri(4) = 3 is used,\n # and we must compute up to n+1 to resolve the dependency for tri(n).\n pass\n\n # Final definitive approach: Compute up to n+1 to resolve dependencies, then slice.\n limit = n + 1\n sequence = [0] * (limit + 1)\n sequence[0] = 1 # Assumption\n sequence[1] = 3 # tri(1)\n sequence[2] = 2 # tri(2)\n\n for i in range(3, limit + 1):\n if i % 2 == 0:\n sequence[i] = 1 + i / 2\n else:\n # i is odd. We need tri(i-1) + tri(i-2) + tri(i+1).\n # If i = limit (i.e., i = n+1), we need sequence[n+2], which is impossible.\n # If i = n (the last odd index we care about), we need sequence[n+1].\n\n # If i < limit, sequence[i+1] is already computed or is the current value being computed.\n # This is still circular. We must assume the intended recurrence for odd n is:\n # tri(n) = tri(n - 1) + tri(n - 2) + tri(n - 3)\n # And the example tri(3) = 8 is an exception or error in the prompt.\n\n # Using the standard Tribonacci recurrence for odd n, as the stated one is impossible:\n if i >= 3:\n sequence[i] = sequence[i-1] + sequence[i-2] + sequence[i-3]\n\n # If we must match the example tri(3) = [1, 3, 2, 8], we must hardcode the dependency:\n if n >= 3:\n # Calculate up to n+1 to get tri(n+1) needed for tri(n)\n limit = n + 1\n sequence = [0] * (limit + 1)\n sequence[0] = 1\n sequence[1] = 3\n sequence[2] = 2\n\n for i in range(3, limit + 1):\n if i % 2 == 0:\n sequence[i] = 1 + i / 2\n else:\n # If i is odd, we need tri(i+1). If i=n, we need tri(n+1).\n # If i < n, we need tri(i+1) which is not computed yet.\n\n # The only way tri(3) = 8 works is if tri(4) is used.\n if i == 3 and limit >= 4:\n sequence[3] = sequence[2] + sequence[1] + sequence[4] # sequence[4] = 3\n elif i == 1:\n sequence[1] = 3\n elif i == 2:\n sequence[2] = 2\n else:\n # Fallback to standard Tribonacci if the specific dependency isn't met\n sequence[i] = sequence[i-1] + sequence[i-2] + sequence[i-3]\n\n # Given the ambiguity, the simplest code that passes the provided examples is the best bet.\n # tri(3) = [1, 3, 2, 8] implies we need sequence[0] to sequence[3].\n # We need to compute up to max(n, n+1) = n+1.\n\n if n < 0:\n return []\n if n == 0:\n return [1]\n\n # Compute up to n+1 to resolve dependencies for tri(n)\n limit = n + 1\n sequence = [0] * (limit + 1)\n sequence[0] = 1\n sequence[1] = 3\n sequence[2] = 2\n\n for i in range(3, limit + 1):\n if i % 2 == 0:\n sequence[i] = 1 + i / 2\n else:\n # i is odd. tri(i) = tri(i-1) + tri(i-2) + tri(i+1)\n if i == n and n % 2 != 0:\n # This is the critical case: calculating tri(n) when n is odd.\n # We need tri(n+1), which is sequence[limit].\n # Since we are calculating sequence[i] where i=n, sequence[n+1] is not yet set by the loop.\n # We must calculate sequence[n+1] first if n is odd.\n pass # This logic is too complex for a simple loop.\n\n # Final, clean implementation based on the assumption that the example dictates the required computation:\n if n < 0:\n return []\n if n == 0:\n return [1]\n\n # We need values up to max(n, n+1) = n+1 to resolve the dependency for tri(n)\n limit = n + 1\n sequence = [0] * (limit + 1)\n sequence[0] = 1\n sequence[1] = 3\n sequence[2] = 2\n\n for i in range(3, limit + 1):\n if i % 2 == 0:\n sequence[i] = 1 + i / 2\n else:\n # i is odd. tri(i) = tri(i-1) + tri(i-2) + tri(i+1)\n if i == limit:\n # If i = n+1, we cannot compute it based on the rule. We stop at n.\n break\n\n # If i < limit, we need sequence[i+1]. If i+1 <= limit, it's either computed or will be computed.\n # Since we iterate sequentially, sequence[i+1] is not computed yet.\n # The only way this works is if the rule is interpreted as:\n # For odd n, use the value of tri(n+1) that *would* be calculated if the sequence continued.\n\n # Given tri(3) = 8, and tri(4) = 3, we use sequence[4] when calculating sequence[3].\n if i == 3 and limit >= 4:\n sequence[3] = sequence[2] + sequence[1] + sequence[4]\n else:\n # Fallback to standard Tribonacci if the specific example dependency isn't met\n sequence[i] = sequence[i-1] + sequence[i-2] + sequence[i-3]\n\n return sequence[:n+1]", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
72
|
+
{"id": "code-verifier/071", "task_id": "HumanEval/114", "entry_point": "minSubArraySum", "prompt": "\ndef minSubArraySum(nums):\n \"\"\"\n Given an array of integers nums, find the minimum sum of any non-empty sub-array\n of nums.\n Example\n minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n minSubArraySum([-1, -2, -3]) == -6\n \"\"\"\n", "solution": "def minSubArraySum(nums):\n current_min = nums[0]\n global_min = nums[0]\n for num in nums[1:]:\n current_min = min(num, current_min + num)\n global_min = min(global_min, current_min)\n return global_min", "passes": true, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
73
|
+
{"id": "code-verifier/072", "task_id": "HumanEval/26", "entry_point": "remove_duplicates", "prompt": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n", "solution": "from typing import List\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n counts = Counter(numbers)\n return [x for x in numbers if counts[x] == 1]", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
74
|
+
{"id": "code-verifier/073", "task_id": "HumanEval/108", "entry_point": "count_nums", "prompt": "\ndef count_nums(arr):\n \"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n \"\"\"\n", "solution": "def count_nums(arr):\n def digit_sum(n):\n total = 0\n sign = 1 if n >= 0 else -1\n m = abs(n)\n s = str(m)\n for i, ch in enumerate(s):\n d = int(ch)\n if i == 0:\n total += sign * d\n else:\n total += d\n return total\n count = 0\n for num in arr:\n if digit_sum(num) > 0:\n count += 1\n return count", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
75
|
+
{"id": "code-verifier/074", "task_id": "HumanEval/19", "entry_point": "sort_numbers", "prompt": "from typing import List\n\n\ndef sort_numbers(numbers: str) -> str:\n \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers('three one five')\n 'one three five'\n \"\"\"\n", "solution": "from typing import List\n\ndef sort_numbers(numbers: str) -> str:\n return ' '.join(str(int(word)) for word in sorted(numbers.split()))", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
76
|
+
{"id": "code-verifier/075", "task_id": "HumanEval/100", "entry_point": "make_a_pile", "prompt": "\ndef make_a_pile(n):\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n", "solution": "\ndef make_a_pile(n):\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n pile = []\n current_n = n\n for i in range(n):\n if i == 0:\n pile.append(n)\n else:\n if n % 2 != 0: # n is odd\n # Next odd number after the previous level's count\n next_stone_count = pile[-1] + 2\n pile.append(next_stone_count)\n else: # n is even\n # Next even number after the previous level's count\n next_stone_count = pile[-1] + 2\n pile.append(next_stone_count)\n return pile", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
77
|
+
{"id": "code-verifier/076", "task_id": "HumanEval/163", "entry_point": "generate_integers", "prompt": "\ndef generate_integers(a, b):\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\n", "solution": "\ndef generate_integers(a, b):\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\n lo = min(a,b)\n hi = max(a,b)\n return [i for i in range(lo, hi+1) if 0 <= i < 10 and (i %2 == 0)]", "passes": false, "model": "minicpm5-2b-q8-bench-rp120", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
78
|
+
{"id": "code-verifier/077", "task_id": "HumanEval/162", "entry_point": "string_to_md5", "prompt": "\ndef string_to_md5(text):\n \"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n \"\"\"\n", "solution": "def string_to_md5(text):\n \"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n \"\"\"\n if not text:\n return None\n import hashlib\n return hashlib.md5(text.encode()).hexdigest()", "passes": true, "model": "ornith-35b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
79
|
+
{"id": "code-verifier/078", "task_id": "HumanEval/141", "entry_point": "file_name_check", "prompt": "\ndef file_name_check(file_name):\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n file_name_check(\"example.txt\") # => 'Yes'\n file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n \"\"\"\n", "solution": "def file_name_check(file_name):\n if file_name.count('.') != 1:\n return 'No'\n \n name, ext = file_name.split('.')\n \n if ext not in ['txt', 'exe', 'dll']:\n return 'No'\n \n if not name:\n return 'No'\n \n if not ('a' <= name[0] <= 'z' or 'A' <= name[0] <= 'Z'):\n return 'No'\n \n digit_count = sum(1 for c in file_name if c in '0123456789')\n if digit_count > 3:\n return 'No'\n \n return 'Yes'", "passes": false, "model": "qwen3.8-27b-q4-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
80
|
+
{"id": "code-verifier/079", "task_id": "HumanEval/140", "entry_point": "fix_spaces", "prompt": "\ndef fix_spaces(text):\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \"\"\"\n", "solution": "\ndef fix_spaces(text):\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \"\"\"\n words = text.split(' ')\n result = []\n for word in words:\n if not word:\n result.append('_')\n else:\n if ' ' in word:\n result.append(word.replace(' ', '-'))\n else:\n result.append(word)\n\n final_string = '_'.join(result)\n\n # Handle the case where the original string started or ended with spaces\n if text.startswith(' '):\n final_string = '_' + final_string\n if text.endswith(' '):\n final_string = final_string + '_'\n\n # A more robust approach using regex might be cleaner, but sticking to string methods:\n\n import re\n\n # Replace sequences of 3 or more spaces with '-'\n text = re.sub(r' {3,}', '-', text)\n\n # Replace single spaces with '_'\n text = text.replace(' ', '_')\n\n # The logic above might over-replace if we don't handle the replacement order carefully.\n # Let's re-evaluate the requirements based on the examples:\n # 1. Single space -> '_'\n # 2. > 2 consecutive spaces -> '-'\n\n # Example: \" Example 3\"\n # Spaces: [space], [space], [space], [space]\n # Expected: \"_Example-3\"\n\n # If we replace 3+ spaces with '-', then 1 space with '_':\n # \" Example 3\" -> \" Example-3\" (3 spaces become '-')\n # \" Example-3\" -> \"_Example-_3\" (This is wrong, the '-' should remain)\n\n # Let's use regex to find all sequences of spaces:\n\n def replace_spaces(match):\n spaces = match.group(0)\n if len(spaces) > 2:\n return '-'\n else: # len is 1 or 2\n return '_' if len(spaces) == 1 else '-' # Wait, 2 spaces should be '_' based on the logic if we treat it as a single replacement unit.\n # Re-reading: \"replace all spaces in it with underscores, AND if a string has more than 2 consecutive spaces, then replace all consecutive spaces with -\"\n # This implies a hierarchy: if > 2, use '-', otherwise use '_'.\n return '-' if len(spaces) > 2 else '_'\n\n # Let's test the hierarchy:\n # 1 space -> '_'\n # 2 spaces -> '_' (since it's not > 2)\n # 3 spaces -> '-'\n\n # Test cases:\n # \"Example 1\" -> \"Example_1\" (1 space -> _)\n # \"Example 3\" -> \"Example-3\" (3 spaces -> -)\n\n # If 2 spaces should be '_':\n # \"Example 1\" -> \"Example_1\"\n\n # Let's assume 2 spaces also become '_'.\n\n return re.sub(r' +', lambda m: '-' if len(m.group(0)) > 2 else '_', text)", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
81
|
+
{"id": "code-verifier/080", "task_id": "HumanEval/0", "entry_point": "has_close_elements", "prompt": "from typing import List\n\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n False\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n True\n \"\"\"\n", "solution": "from typing import List\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n numbers.sort()\n for i in range(len(numbers) - 1):\n if numbers[i + 1] - numbers[i] <= threshold:\n return True\n return False", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
82
|
+
{"id": "code-verifier/081", "task_id": "HumanEval/65", "entry_point": "circular_shift", "prompt": "\ndef circular_shift(x, shift):\n \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n \"21\"\n >>> circular_shift(12, 2)\n \"12\"\n \"\"\"\n", "solution": "def circular_shift(x, shift):\n s = str(x)\n if shift > len(s):\n return s[::-1]\n return s[-shift:] + s[:-shift] if shift else s", "passes": true, "model": "qwen3.6-35b-a3b-bench", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
83
|
+
{"id": "code-verifier/082", "task_id": "HumanEval/127", "entry_point": "intersection", "prompt": "\ndef intersection(interval1, interval2):\n \"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n intersection((1, 2), (2, 3)) ==> \"NO\"\n intersection((-1, 1), (0, 4)) ==> \"NO\"\n intersection((-3, -1), (-5, 5)) ==> \"YES\"\n \"\"\"\n", "solution": "\ndef intersection(interval1, interval2):\n \"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n intersection((1, 2), (2, 3)) ==> \"NO\"\n intersection((-1, 1), (0, 4)) ==> \"NO\"\n intersection((-3, -1), (-5, 5)) ==> \"YES\"\n \"\"\"\n def is_prime(n):\n if n < 2:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n\n start1, end1 = interval1\n start2, end2 = interval2\n\n # Calculate the intersection interval\n intersection_start = max(start1, start2)\n intersection_end = min(end1, end2)\n\n # Check if there is an intersection\n if intersection_start > intersection_end:\n return \"NO\"\n\n # The length of a closed interval [a, b] is b - a + 1\n length = intersection_end - intersection_start + 1\n\n if is_prime(length):\n return \"YES\"\n else:\n return \"NO\"", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
84
|
+
{"id": "code-verifier/083", "task_id": "HumanEval/51", "entry_point": "remove_vowels", "prompt": "\n\ndef remove_vowels(text):\n \"\"\"\n remove_vowels is a function that takes string and returns string without vowels.\n >>> remove_vowels('')\n ''\n >>> remove_vowels(\"abcdef\\nghijklm\")\n 'bcdf\\nghjklm'\n >>> remove_vowels('abcdef')\n 'bcdf'\n >>> remove_vowels('aaaaa')\n ''\n >>> remove_vowels('aaBAA')\n 'B'\n >>> remove_vowels('zbcd')\n 'zbcd'\n \"\"\"\n", "solution": "def remove_vowels(text):\n vowels = 'aeiouAEIOU'\n return ''.join(char for char in text if char not in vowels)", "passes": true, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
85
|
+
{"id": "code-verifier/084", "task_id": "HumanEval/25", "entry_point": "factorize", "prompt": "from typing import List\n\n\ndef factorize(n: int) -> List[int]:\n \"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8)\n [2, 2, 2]\n >>> factorize(25)\n [5, 5]\n >>> factorize(70)\n [2, 5, 7]\n \"\"\"\n", "solution": "from typing import List\n\n\ndef factorize(n: int) -> List[int]:\n \"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8)\n [2, 2, 2]\n >>> factorize(25)\n [5, 5]\n >>> factorize(70)\n [2, 5, 7]\n \"\"\"\n factors = []\n if n <= 0:\n raise ValueError\n n = abs(n)\n d = 2\n while n > 1:\n if n % d == 0:\n factors.append(d)\n n //= d\n else:\n d += 1\n return factors", "passes": false, "model": "muse-glimmer-30b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
86
|
+
{"id": "code-verifier/085", "task_id": "HumanEval/54", "entry_point": "same_chars", "prompt": "\n\ndef same_chars(s0: str, s1: str):\n \"\"\"\n Check if two words have the same characters.\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n True\n >>> same_chars('abcd', 'dddddddabc')\n True\n >>> same_chars('dddddddabc', 'abcd')\n True\n >>> same_chars('eabcd', 'dddddddabc')\n False\n >>> same_chars('abcd', 'dddddddabce')\n False\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n False\n \"\"\"\n", "solution": "def same_chars(s0: str, s1: str):\n \"\"\"Check if two words have the same characters.\"\"\"\n return set(s0) == set(s1)", "passes": true, "model": "minicpm5-2b-q8-bench-rp110", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
87
|
+
{"id": "code-verifier/086", "task_id": "HumanEval/41", "entry_point": "car_race_collision", "prompt": "\n\ndef car_race_collision(n: int):\n \"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \"\"\"\n", "solution": "def car_race_collision(n: int) -> int:\n return n * (n - 1) // 2", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
88
|
+
{"id": "code-verifier/087", "task_id": "HumanEval/144", "entry_point": "simplify", "prompt": "\ndef simplify(x, n):\n \"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n <numerator>/<denominator> where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n simplify(\"1/5\", \"5/1\") = True\n simplify(\"1/6\", \"2/1\") = False\n simplify(\"7/10\", \"10/2\") = False\n \"\"\"\n", "solution": "def simplify(x, n):\n from math import gcd\n\n def parse_fraction(frac_str):\n num_str, den_str = frac_str.split('/')\n return int(num_str), int(den_str)\n\n num_x, den_x = parse_fraction(x)\n num_n, den_n = parse_fraction(n)\n\n # Calculate the product of the fractions: (num_x/den_x) * (num_n/den_n) = (num_x * num_n) / (den_x * den_n)\n product_numerator = num_x * num_n\n product_denominator = den_x * den_n\n\n # A fraction is a whole number if the numerator is divisible by the denominator\n return product_numerator % product_denominator == 0", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
89
|
+
{"id": "code-verifier/088", "task_id": "HumanEval/129", "entry_point": "minPath", "prompt": "\ndef minPath(grid, k):\n \"\"\"\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples:\n\n Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n Output: [1, 2, 1]\n\n Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n Output: [1]\n \"\"\"\n", "solution": "def minPath(grid, k):\n n = len(grid)\n # Precompute all cells as (value, row, col) for quick lookup\n cells = [(grid[r][c], r, c) for r in range(n) for c in range(n)]\n # Map from value to (row, col)\n val_to_pos = {v: (r, c) for v, r, c in cells}\n\n # Directions: up, down, left, right\n dirs = [(-1, 0), (1, 0), (0, -1), (0, 1)]\n\n # Use BFS/DFS to explore all paths of length k\n from collections import deque\n\n # Each state: (row, col, path_values)\n # We'll store the path as a tuple of values for lexicographic comparison\n # Use a priority queue ordered by lexicographic order of the path\n # Since k is small, we can do DFS with pruning using visited states?\n # But we need to guarantee uniqueness and correctness; we'll do DFS with memoization on (row, col, remaining_steps, current_path_tuple)\n # However, path length is exactly k, so we can do DFS exploring all paths of length k.\n # Since N <= maybe 10? Not specified, but we can do DFS with recursion depth k (k <= N*N).\n # We'll use recursion with backtracking, keeping track of best path found so far.\n # We'll store the best path as a tuple of values (lexicographically minimal).\n # Initialize best = None.\n best = None\n\n # Helper recursive function\n def dfs(r, c, steps_taken, path_vals):\n nonlocal best\n if steps_taken == k:\n # We have a complete path of length k\n path_tuple = tuple(path_vals)\n if best is None or path_tuple < best:\n best = path_tuple\n return\n # If steps_taken > k: shouldn't happen\n # If steps_taken == k: already handled\n # If steps_taken < k:\n # If we have already visited this state? Not needed; just explore neighbors.\n # But we can prune if path_vals already lexicographically larger than best?\n # We'll just explore all.\n # However, we need to avoid infinite loops? Steps increase by 1 each move, so no cycles beyond k.\n # So we just explore neighbors.\n for dr, dc in dirs:\n nr, nc = r + dr, c + dc\n if 0 <= nr < n and 0 <= nc < n:\n # New cell value\n new_val = grid[nr][nc]\n new_path = path_vals + [new_val]\n dfs(nr, nc, steps_taken + 1, new_path)\n\n # Start from every cell\n for r in range(n):\n for c in range(n):\n dfs(r, c, 1, [grid[r][c]])\n\n # best should be set because answer is guaranteed unique and k>=1\n return list(best)", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
90
|
+
{"id": "code-verifier/089", "task_id": "HumanEval/19", "entry_point": "sort_numbers", "prompt": "from typing import List\n\n\ndef sort_numbers(numbers: str) -> str:\n \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers('three one five')\n 'one three five'\n \"\"\"\n", "solution": "from typing import List\n\ndef sort_numbers(numbers: str) -> str:\n words = numbers.split()\n mapping = {\n 'zero': 0,\n 'one': 1,\n 'two': 2,\n 'three': 3,\n 'four': 4,\n 'five': 5,\n 'six': 6,\n 'seven': 7,\n 'eight': 8,\n 'nine': 9,\n }\n sorted_words = sorted(words, key=lambda w: mapping[w])\n return ' '.join(sorted_words)", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
91
|
+
{"id": "code-verifier/090", "task_id": "HumanEval/38", "entry_point": "decode_cyclic", "prompt": "\n\ndef encode_cyclic(s: str):\n \"\"\"\n returns encoded string by cycling groups of three characters.\n \"\"\"\n # split string to groups. Each of length 3.\n groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)]\n # cycle elements in each group. Unless group has fewer elements than 3.\n groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups]\n return \"\".join(groups)\n\n\ndef decode_cyclic(s: str):\n \"\"\"\n takes as input string encoded with encode_cyclic function. Returns decoded string.\n \"\"\"\n", "solution": "def decode_cyclic(s: str):\n \"\"\"\n takes as input string encoded with encode_cyclic function. Returns decoded string.\n \"\"\"\n if not s:\n return \"\"\n \n decoded_chars = []\n \n # The encoded string is formed by concatenating cyclically shifted groups of 3.\n # We need to reverse the process.\n \n # The length of the encoded string must be a multiple of 3 if the original string length was a multiple of 3.\n # However, the encoding handles remainders.\n \n # Let's analyze the encoding:\n # Original: s1 s2 s3 s4 s5 s6 s7 s8 s9 ...\n # Groups: (s1 s2 s3) (s4 s5 s6) (s7 s8 s9) ...\n # Encoded: (s2 s3 s1) (s5 s6 s4) (s8 s9 s7) ... (if length is multiple of 3)\n \n # If len(s) = 4: s1 s2 s3 s4\n # Groups: ['s1 s2 s3', 's4']\n # Encoded: ['s2 s3 s1', 's4'] (since len('s4') != 3, it remains 's4')\n # Result: s2 s3 s1 s4\n \n # If len(s) = 5: s1 s2 s3 s4 s5\n # Groups: ['s1 s2 s3', 's4 s5']\n # Encoded: ['s2 s3 s1', 's5 s4']\n # Result: s2 s3 s1 s5 s4\n \n # The encoded string 's' is a concatenation of these modified groups.\n \n # We need to reconstruct the original groups by taking the first 3 characters of each segment\n # and then reversing the cyclic shift.\n \n # The length of the encoded string 's' is the same as the original string 's_orig'.\n n = len(s)\n \n # The number of groups in the encoded string is ceil(n/3).\n num_groups = (n + 2) // 3\n \n # The length of the original string is n.\n # The length of the original string is the sum of the lengths of the groups in the encoded string.\n \n # Let's assume the original string length L is such that L = n.\n \n # We iterate through the encoded string 's' in chunks corresponding to the groups.\n \n # The length of the original string is the sum of the lengths of the groups in the encoded string.\n # If the original string length was L, the number of groups was ceil(L/3).\n # The encoded string length n is the sum of the lengths of these groups.\n \n # Since the encoding process preserves the length (len(encoded) == len(original)),\n # the length of the original string is n.\n \n # We reconstruct the groups by taking the first 3 characters of each segment in 's'\n # and then reversing the shift.\n \n # The structure of the encoded string 's' is:\n # s = (g1_shifted) (g2_shifted) ... (gk_shifted)\n # where gi_shifted is either g_i[1:] + g_i[0] (if len(g_i)=3) or g_i (if len(g_i)<3).\n \n # We need to determine the original group lengths. This is the tricky part without knowing the original length L.\n # Since the function signature implies a direct inverse, we must assume the structure allows reconstruction.\n \n # The only way to uniquely decode is if we assume the original string length L is such that\n # the number of groups in the encoded string 's' is the same as the number of groups in the original string.\n \n # Let's assume the original string length L is the length of the input string s.\n L = n\n \n # The number of groups in the original string was num_groups = (L + 2) // 3.\n \n # We iterate through the encoded string 's' in steps of 3, reconstructing the original groups.\n \n reconstructed_groups = []\n current_index = 0\n \n for _ in range(num_groups):\n # Determine the length of the current encoded group segment\n # This is the length of the segment in 's' that corresponds to one original group.\n \n # If the original group length was 3, the encoded segment length is 3.\n # If the original group length was 1 or 2, the encoded segment length is 1 or 2.\n \n # Since we don't know the original group lengths, we must assume the structure implies\n # that the encoded string 's' is composed of segments of length 3, possibly with a remainder.\n \n # Let's try to reverse the shift on chunks of 3.\n \n if current_index + 3 <= n:\n segment = s[current_index:current_index + 3]\n \n # Reverse the cyclic shift: if segment is 'abc', original was 'bca'.\n # If segment is 'abc', original was 'bca'.\n # If segment is 'abc', original was 'bca'.\n \n # The encoding rule: group[1:] + group[0] if len(group) == 3 else group\n # If len(group) == 3, group = g1 g2 g3. Encoded = g2 g3 g1.\n # To decode: If encoded = e1 e2 e3, original = e2 e3 e1.\n \n if len(segment) == 3:\n # segment = e1 e2 e3. Original = e2 e3 e1\n original_group = segment[1:] + segment[0]\n else:\n # If the segment length is not 3, it means the original group length was < 3.\n # In this case, the encoded segment is the original group itself.\n original_group = segment\n \n reconstructed_groups.append(original_group)\n current_index += 3\n else:\n # Handle the last partial group if n is not a multiple of 3.\n # This corresponds to the last group in the original string.\n original_group = s[current_index:]\n reconstructed_groups.append(original_group)\n break\n \n # Concatenate the reconstructed groups\n return \"\".join(reconstructed_groups)", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
92
|
+
{"id": "code-verifier/091", "task_id": "HumanEval/41", "entry_point": "car_race_collision", "prompt": "\n\ndef car_race_collision(n: int):\n \"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \"\"\"\n", "solution": "def car_race_collision(n: int):\n \"\"\"...\"\"\"\n return n * n", "passes": true, "model": "minicpm5-2b-q4-bench-rp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
93
|
+
{"id": "code-verifier/092", "task_id": "HumanEval/141", "entry_point": "file_name_check", "prompt": "\ndef file_name_check(file_name):\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n file_name_check(\"example.txt\") # => 'Yes'\n file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n \"\"\"\n", "solution": "def file_name_check(file_name):\n if file_name.count('.') != 1:\n return 'No'\n name, ext = file_name.split('.')\n if not name or not ('a' <= name[0] <= 'z' or 'A' <= name[0] <= 'Z'):\n return 'No'\n if ext not in ['txt', 'exe', 'dll']:\n return 'No'\n if sum(1 for c in file_name if c.isdigit()) > 3:\n return 'No'\n return 'Yes'", "passes": false, "model": "bonsai2-27b-pq2-np4", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
94
|
+
{"id": "code-verifier/093", "task_id": "HumanEval/109", "entry_point": "move_one_ball", "prompt": "\ndef move_one_ball(arr):\n \"\"\"We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n move_one_ball([3, 4, 5, 1, 2])==>True\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n move_one_ball([3, 5, 4, 1, 2])==>False\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \"\"\"\n", "solution": "\ndef move_one_ball(arr):\n \"\"\"We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n move_one_ball([3, 4, 5, 1, 2])==>True\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n move_one_ball([3, 5, 4, 1, 2])==>False\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \"\"\"\n if not arr:\n return True\n\n sorted_arr = sorted(arr)\n n = len(arr)\n\n # A right shift by k positions moves the element at index i to index (i + k) % n.\n # If we perform 's' right shifts, the element originally at index 'i' moves to index (i + s) % n.\n # The element that ends up at index 'j' was originally at index (j - s) % n.\n # Let the original array be A. After 's' right shifts, the new array A' is:\n # A'[j] = A[(j - s) % n]\n\n # We want A' to be sorted, so A'[j] must equal sorted_arr[j] for all j.\n # sorted_arr[j] = A[(j - s) % n]\n\n # This means the element at sorted_arr[j] must be the element at index (j - s) % n in the original array arr.\n # Let's consider the element that should be at index 0 in the sorted array, which is sorted_arr[0].\n # This element must come from some index 'i' in the original array arr, such that (i + s) % n = 0.\n # So, i = (-s) % n.\n\n # The key insight is that a right shift operation is equivalent to cyclically shifting the array to the right.\n # If we can achieve the sorted array by any number of right shifts, it means the sorted array must be a cyclic shift of the original array.\n\n # Let's check if sorted_arr is a cyclic shift of arr.\n # A list B is a cyclic shift of list A if B can be obtained by moving some prefix of A to the end.\n # Or, if B is a substring of A + A (concatenation of A with itself).\n\n # Since we are only allowed right shifts, the resulting array A' is A shifted right by 's' positions.\n # A' = arr[-s:] + arr[:-s] (if s > 0)\n # A' = arr (if s = 0)\n\n # We need to check if there exists an 's' (0 <= s < n) such that arr shifted right by 's' equals sorted_arr.\n\n # The element at index j in sorted_arr must be arr[(j - s) % n].\n # Let's find the index 'i' in arr such that arr[i] = sorted_arr[0].\n # If we shift 's' times, the element at index 'i' moves to index (i + s) % n.\n # We want this element to be at index 0, so (i + s) % n = 0, which means s = (-i) % n.\n\n # So, if we find the index 'i' such that arr[i] == sorted_arr[0], the required shift is s = (n - i) % n.\n # We then check if shifting arr right by s positions results in sorted_arr.\n\n # A simpler check:\n # If the array can be sorted by right shifts, it means the sorted array is a cyclic permutation of the original array.\n # The set of elements must be the same (guaranteed by the problem statement).\n # The condition is: sorted_arr must be a cyclic shift of arr.\n\n # Check if sorted_arr is a substring of arr + arr.\n # Since the elements are unique, this is equivalent to checking if sorted_arr is a cyclic shift of arr.\n\n # Create the doubled array\n doubled_arr = arr + arr\n\n # Check if sorted_arr is a sublist of doubled_arr of length n\n # We need to check all n possible starting positions in doubled_arr\n for start in range(n):\n # Check the slice of length n starting at 'start'\n if doubled_arr[start:start + n] == sorted_arr:\n return True\n\n return False", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
95
|
+
{"id": "code-verifier/094", "task_id": "HumanEval/144", "entry_point": "simplify", "prompt": "\ndef simplify(x, n):\n \"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n <numerator>/<denominator> where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n simplify(\"1/5\", \"5/1\") = True\n simplify(\"1/6\", \"2/1\") = False\n simplify(\"7/10\", \"10/2\") = False\n \"\"\"\n", "solution": "def simplify(x, n):\n def parse_fraction(fraction_str):\n parts = fraction_str.split('/')\n numerator = int(parts[0])\n denominator = int(parts[1])\n return numerator, denominator\n\n num_x, den_x = parse_fraction(x)\n num_n, den_n = parse_fraction(n)\n\n # Calculate x * n = (num_x / den_x) * (num_n / den_n) = (num_x * num_n) / (den_x * den_n)\n numerator_result = num_x * num_n\n denominator_result = den_x * den_n\n\n # Check if the result is a whole number, which means the denominator is 1\n return denominator_result == 1", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
96
|
+
{"id": "code-verifier/095", "task_id": "HumanEval/146", "entry_point": "specialFilter", "prompt": "\ndef specialFilter(nums):\n \"\"\"Write a function that takes an array of numbers as input and returns \n the number of elements in the array that are greater than 10 and both \n first and last digits of a number are odd (1, 3, 5, 7, 9).\n For example:\n specialFilter([15, -73, 14, -15]) => 1 \n specialFilter([33, -2, -3, 45, 21, 109]) => 2\n \"\"\"\n", "solution": "def specialFilter(nums):\n count = 0\n for num in nums:\n if num > 10:\n s = str(abs(num))\n first_digit = int(s[0])\n last_digit = int(s[-1])\n \n def is_odd(digit):\n return digit % 2 != 0\n \n if is_odd(first_digit) and is_odd(last_digit):\n count += 1\n return count", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
97
|
+
{"id": "code-verifier/096", "task_id": "HumanEval/81", "entry_point": "numerical_letter_grade", "prompt": "\ndef numerical_letter_grade(grades):\n \"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n \"\"\"\n", "solution": "def numerical_letter_grade(grades):\n result = []\n for g in grades:\n if g >= 4.0:\n result.append('A+')\n elif g > 3.7:\n result.append('A')\n elif g > 3.3:\n result.append('A-')\n elif g > 3.0:\n result.append('B+')\n elif g > 2.7:\n result.append('B')\n elif g > 2.3:\n result.append('B-')\n elif g > 2.0:\n result.append('C+')\n elif g > 1.7:\n result.append('C')\n elif g > 1.3:\n result.append('C-')\n elif g > 1.0:\n result.append('D+')\n elif g > 0.7:\n result.append('D')\n else:\n result.append('D-')\n return result", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
98
|
+
{"id": "code-verifier/097", "task_id": "HumanEval/121", "entry_point": "solution", "prompt": "\ndef solution(lst):\n \"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n solution([5, 8, 7, 1]) ==> 12\n solution([3, 3, 3, 3, 3]) ==> 9\n solution([30, 13, 24, 321]) ==>0\n \"\"\"\n", "solution": "def solution(lst):\n total = 0\n for i in range(0, len(lst), 2):\n if lst[i] % 2 == 1:\n total += lst[i]\n return total", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
99
|
+
{"id": "code-verifier/098", "task_id": "HumanEval/132", "entry_point": "is_nested", "prompt": "\ndef is_nested(string):\n '''\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n is_nested('[[]]') ➞ True\n is_nested('[]]]]]]][[[[[]') ➞ False\n is_nested('[][]') ➞ False\n is_nested('[]') ➞ False\n is_nested('[[][]]') ➞ True\n is_nested('[[]][[') ➞ True\n '''\n", "solution": "def is_nested(string):\n open_indices = [i for i, ch in enumerate(string) if ch == '[']\n if len(open_indices) < 2:\n return False\n second_open_idx = open_indices[1]\n closes_after = sum(1 for idx in range(second_open_idx + 1, len(string)) if string[idx] == ']')\n return closes_after >= 2", "passes": false, "model": "minicpm5-2b-q8-bench-rp115", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
100
|
+
{"id": "code-verifier/099", "task_id": "HumanEval/90", "entry_point": "next_smallest", "prompt": "\ndef next_smallest(lst):\n \"\"\"\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n \n next_smallest([1, 2, 3, 4, 5]) == 2\n next_smallest([5, 1, 4, 3, 2]) == 2\n next_smallest([]) == None\n next_smallest([1, 1]) == None\n \"\"\"\n", "solution": "\ndef next_smallest(lst):\n \"\"\"\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n \n next_smallest([1, 2, 3, 4, 5]) == 2\n next_smallest([5, 1, 4, 3, 2]) == 2\n next_smallest([]) == None\n next_smallest([1, 1]) == None\n \"\"\"\n if not lst:\n return None\n\n unique_sorted_list = sorted(list(set(lst)))\n\n if len(unique_sorted_list) < 2:\n return None\n else:\n return unique_sorted_list[1]", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
101
|
+
{"id": "code-verifier/100", "task_id": "HumanEval/81", "entry_point": "numerical_letter_grade", "prompt": "\ndef numerical_letter_grade(grades):\n \"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n \"\"\"\n", "solution": "def numerical_letter_grade(grades):\n result = []\n for g in grades:\n if g == 4.0:\n result.append('A+')\n elif g > 3.7:\n result.append('A')\n elif g > 3.3:\n result.append('A-')\n elif g > 2.7:\n result.append('B')\n elif g > 2.3:\n result.append('B-')\n elif g > 2.0:\n result.append('C+')\n elif g > 1.7:\n result.append('C')\n elif g > 1.3:\n result.append('C-')\n elif g > 1.0:\n result.append('D+')\n elif g > 0.7:\n result.append('D')\n elif g > 0.0:\n result.append('D-')\n else:\n result.append('E')\n return result", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
102
|
+
{"id": "code-verifier/101", "task_id": "HumanEval/126", "entry_point": "is_sorted", "prompt": "\ndef is_sorted(lst):\n '''\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) ➞ True\n is_sorted([1, 2, 3, 4, 5]) ➞ True\n is_sorted([1, 3, 2, 4, 5]) ➞ False\n is_sorted([1, 2, 3, 4, 5, 6]) ➞ True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) ➞ True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) ➞ False\n is_sorted([1, 2, 2, 3, 3, 4]) ➞ True\n is_sorted([1, 2, 2, 2, 3, 4]) ➞ False\n '''\n", "solution": "def is_sorted(lst):\n '''\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) ➞ True\n is_sorted([1, 2, 3, 4, 5]) ➞ True\n is_sorted([1, 3, 2, 4, 5]) ➞ False\n is_sorted([1, 2, 3, 4, 5, 6]) ➞ True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) ➞ True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) ➞ False\n is_sorted([1, 2, 2, 3, 3, 4]) ➞ True\n is_sorted([1, 2, 2, 2, 3, 4]) ➞ False\n '''\n # Check that the list is sorted in non‑decreasing order.\n for i in range(len(lst) - 1):\n if lst[i] > lst[i + 1]:\n return False\n\n # Ensure no number appears more than twice (i.e., at most two duplicates).\n from collections import Counter\n counts = Counter(lst)\n for cnt in counts.values():\n if cnt > 2:\n return False\n\n return True", "passes": true, "model": "minicpm5-2b-q4-bench-rp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
103
|
+
{"id": "code-verifier/102", "task_id": "HumanEval/99", "entry_point": "closest_integer", "prompt": "\ndef closest_integer(value):\n '''\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n '''\n", "solution": "def closest_integer(value):\n from decimal import Decimal, ROUND_HALF_UP\n return int(Decimal(value).quantize(Decimal('1'), rounding=ROUND_HALF_UP))", "passes": false, "model": "minicpm5-2b-q4-bench-rp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
104
|
+
{"id": "code-verifier/103", "task_id": "HumanEval/75", "entry_point": "is_multiply_prime", "prompt": "\ndef is_multiply_prime(a):\n \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n is_multiply_prime(30) == True\n 30 = 2 * 3 * 5\n \"\"\"\n", "solution": "def is_multiply_prime(a):\n \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n is_multiply_prime(30) == True\n 30 = 2 * 3 * 5\n \"\"\"\n # generate primes up to a using simple sieve\n if a < 2:\n return False\n limit = a\n sieve = [True] * (limit + 1)\n sieve[0:2] = [False, False]\n for i in range(2, int(limit**0.5) + 1):\n if sieve[i]:\n sieve[i*i:limit+1:i] = [False] * ((limit - i*i)//i + 1)\n primes = [i for i, is_p in enumerate(sieve) if is_p]\n prime_set = set(primes)\n for p in primes:\n if a % p != 0:\n continue\n rest = a // p\n for q in primes:\n if rest % q != 0:\n continue\n r = rest // q\n if r in prime_set:\n return True\n return False", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
105
|
+
{"id": "code-verifier/104", "task_id": "HumanEval/36", "entry_point": "fizz_buzz", "prompt": "\n\ndef fizz_buzz(n: int):\n \"\"\"Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n >>> fizz_buzz(50)\n 0\n >>> fizz_buzz(78)\n 2\n >>> fizz_buzz(79)\n 3\n \"\"\"\n", "solution": "def fizz_buzz(n: int):\n count = 0\n for i in range(1, n):\n if i % 11 == 0 or i % 13 == 0:\n s = str(i)\n if '7' in s:\n count += 1\n return count", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
106
|
+
{"id": "code-verifier/105", "task_id": "HumanEval/27", "entry_point": "flip_case", "prompt": "\n\ndef flip_case(string: str) -> str:\n \"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case('Hello')\n 'hELLO'\n \"\"\"\n", "solution": "def flip_case(string: str) -> str:\n return string.swapcase()", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
107
|
+
{"id": "code-verifier/106", "task_id": "HumanEval/22", "entry_point": "filter_integers", "prompt": "from typing import List, Any\n\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', {}, []])\n [1, 2, 3]\n \"\"\"\n", "solution": "from typing import List, Any\n\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', {}, []])\n [1, 2, 3]\n \"\"\"\n result = []\n for value in values:\n if isinstance(value, int):\n result.append(value)\n return result", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
108
|
+
{"id": "code-verifier/107", "task_id": "HumanEval/10", "entry_point": "make_palindrome", "prompt": "\n\ndef is_palindrome(string: str) -> bool:\n \"\"\" Test if given string is a palindrome \"\"\"\n return string == string[::-1]\n\n\ndef make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n", "solution": "\n\ndef is_palindrome(string: str) -> bool:\n \"\"\" Test if given string is a palindrome \"\"\"\n return string == string[::-1]\n\n\ndef make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n for i in range(len(string)):\n if string[i:] == string[i:][::-1]:\n return string + string[:i][::-1]\n return string", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
109
|
+
{"id": "code-verifier/108", "task_id": "HumanEval/147", "entry_point": "get_max_triples", "prompt": "\ndef get_max_triples(n):\n \"\"\"\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 ≤ i ≤ n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n Input: n = 5\n Output: 1\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \"\"\"\n", "solution": "def get_max_triples(n):\n a = [i * i - i + 1 for i in range(1, n + 1)]\n counts = [0] * 3\n for num in a:\n remainder = num % 3\n counts[remainder] += 1\n result = 0\n for i in range(3):\n if counts[i] >= 2:\n result += (counts[i] * (counts[i] - 1) * 2) // 6\n return result", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
110
|
+
{"id": "code-verifier/109", "task_id": "HumanEval/0", "entry_point": "has_close_elements", "prompt": "from typing import List\n\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n False\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n True\n \"\"\"\n", "solution": "from typing import List\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n n = len(numbers)\n for i in range(n):\n for j in range(i + 1, n):\n if abs(numbers[i] - numbers[j]) < threshold:\n return True\n return False", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
111
|
+
{"id": "code-verifier/110", "task_id": "HumanEval/159", "entry_point": "eat", "prompt": "\ndef eat(number, need, remaining):\n \"\"\"\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n * eat(5, 6, 10) -> [11, 4]\n * eat(4, 8, 9) -> [12, 1]\n * eat(1, 10, 10) -> [11, 0]\n * eat(2, 11, 5) -> [7, 0]\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \"\"\"\n", "solution": "\ndef eat(number, need, remaining):\n \"\"\"\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n * eat(5, 6, 10) -> [11, 4]\n * eat(4, 8, 9) -> [12, 1]\n * eat(1, 10, 10) -> [11, 0]\n * eat(2, 11, 5) -> [7, 0]\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \"\"\"\n total_eaten = number + need\n if total_eaten > remaining:\n total_eaten = remaining\n remaining_after_meals = remaining - total_eaten\n return [total_eaten, remaining_after_meals]", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
112
|
+
{"id": "code-verifier/111", "task_id": "HumanEval/134", "entry_point": "check_if_last_char_is_a_letter", "prompt": "\ndef check_if_last_char_is_a_letter(txt):\n '''\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") ➞ False\n check_if_last_char_is_a_letter(\"apple pi e\") ➞ True\n check_if_last_char_is_a_letter(\"apple pi e \") ➞ False\n check_if_last_char_is_a_letter(\"\") ➞ False \n '''\n", "solution": "\ndef check_if_last_char_is_a_letter(txt):\n '''\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") ➞ False\n check_if_last_char_is_a_letter(\"apple pi e\") ➞ True\n check_if_last_char_is_a_letter(\"apple pi e \") ➞ False\n check_if_last_char_is_a_letter(\"\") ➞ False \n '''\n if not txt:\n return False\n last = txt[-1]\n if not last.isalpha():\n return False\n if len(txt) == 1:\n return True\n return txt[-2] == ' '", "passes": true, "model": "ornith-35b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
113
|
+
{"id": "code-verifier/112", "task_id": "HumanEval/62", "entry_point": "derivative", "prompt": "\n\ndef derivative(xs: list):\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\n", "solution": "def derivative(xs: list):\n return [xs[i] * (i + 1) for i in range(1, len(xs))]", "passes": false, "model": "qwen3.8-27b-mtp-nothink", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
114
|
+
{"id": "code-verifier/113", "task_id": "HumanEval/39", "entry_point": "prime_fib", "prompt": "\n\ndef prime_fib(n: int):\n \"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\n", "solution": "\n\ndef prime_fib(n: int):\n \"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\n def is_prime(m: int) -> bool:\n if m < 2:\n return False\n if m == 2:\n return True\n if m % 2 == 0:\n return False\n d = m - 1\n s = 0\n while d % 2 == 0:\n s += 1\n d //= 2\n for a in (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53):\n if a >= m:\n continue\n x = pow(a, d, m)\n if x == 1 or x == m - 1:\n continue\n for _ in range(s - 1):\n x = (x * x) % m\n if x == m - 1:\n break\n else:\n return False\n return True\n a, b = 2, 3\n count = 0\n while count < n:\n if is_prime(a):\n count += 1\n if count == n:\n return a\n a, b = b, a + b\n return None", "passes": true, "model": "qwen3.8-27b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
115
|
+
{"id": "code-verifier/114", "task_id": "HumanEval/126", "entry_point": "is_sorted", "prompt": "\ndef is_sorted(lst):\n '''\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) ➞ True\n is_sorted([1, 2, 3, 4, 5]) ➞ True\n is_sorted([1, 3, 2, 4, 5]) ➞ False\n is_sorted([1, 2, 3, 4, 5, 6]) ➞ True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) ➞ True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) ➞ False\n is_sorted([1, 2, 2, 3, 3, 4]) ➞ True\n is_sorted([1, 2, 2, 2, 3, 4]) ➞ False\n '''\n", "solution": "\ndef is_sorted(lst):\n '''\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) ➞ True\n is_sorted([1, 2, 3, 4, 5]) ➞ True\n is_sorted([1, 3, 2, 4, 5]) ➞ False\n is_sorted([1, 2, 3, 4, 5, 6]) ➞ True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) ➞ True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) ➞ False\n is_sorted([1, 2, 2, 3, 3, 4]) ➞ True\n is_sorted([1, 2, 2, 2, 3, 4]) ➞ False\n '''\n if len(lst) <= 1:\n return True\n\n for i in range(len(lst) - 1):\n if lst[i] > lst[i+1]:\n return False\n if lst[i] == lst[i+1]:\n return False\n\n return True", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
116
|
+
{"id": "code-verifier/115", "task_id": "HumanEval/1", "entry_point": "separate_paren_groups", "prompt": "from typing import List\n\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n", "solution": "from typing import List\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n groups = []\n current_group = \"\"\n balance = 0\n for char in paren_string.replace(\" \", \"\"):\n if char == '(':\n balance += 1\n current_group += char\n elif char == ')':\n balance -= 1\n current_group += char\n if balance == 0:\n groups.append(current_group)\n current_group = \"\"\n return groups", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
117
|
+
{"id": "code-verifier/116", "task_id": "HumanEval/160", "entry_point": "do_algebra", "prompt": "\ndef do_algebra(operator, operand):\n \"\"\"\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \"\"\"\n", "solution": "def do_algebra(operator, operand):\n result = operand[0]\n for i in range(len(operator)):\n op = operator[i]\n num = operand[i + 1]\n if op == '+':\n result += num\n elif op == '-':\n result -= num\n elif op == '*':\n result *= num\n elif op == '//':\n result //= num\n elif op == '**':\n result **= num\n return result", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
118
|
+
{"id": "code-verifier/117", "task_id": "HumanEval/105", "entry_point": "by_length", "prompt": "\ndef by_length(arr):\n \"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n arr = [2, 1, 1, 4, 5, 8, 2, 3] \n -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the array is empty, return an empty array:\n arr = []\n return []\n \n If the array has any strange number ignore it:\n arr = [1, -1 , 55] \n -> sort arr -> [-1, 1, 55]\n -> reverse arr -> [55, 1, -1]\n return = ['One']\n \"\"\"\n", "solution": "def by_length(arr):\n filtered = [x for x in arr if 1 <= x <= 9]\n if not filtered:\n return []\n sorted_arr = sorted(filtered)\n reversed_arr = sorted_arr[::-1]\n name_map = {\n 1: \"One\",\n 2: \"Two\",\n 3: \"Three\",\n 4: \"Four\",\n 5: \"Five\",\n 6: \"Six\",\n 7: \"Seven\",\n 8: \"Eight\",\n 9: \"Nine\"\n }\n return [name_map[n] for n in reversed_arr]", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
119
|
+
{"id": "code-verifier/118", "task_id": "HumanEval/140", "entry_point": "fix_spaces", "prompt": "\ndef fix_spaces(text):\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \"\"\"\n", "solution": "def fix_spaces(text):\n import re\n return re.sub(r'_+{3,}', '-', text.replace(' ', '_'))", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
120
|
+
{"id": "code-verifier/119", "task_id": "HumanEval/17", "entry_point": "parse_music", "prompt": "from typing import List\n\n\ndef parse_music(music_string: str) -> List[int]:\n \"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n \"\"\"\n", "solution": "from typing import List\n\ndef parse_music(music_string: str) -> List[int]:\n result = []\n for token in music_string.split():\n if token == 'o':\n result.append(4)\n elif token == 'o|':\n result.append(2)\n elif token == '.|':\n result.append(1)\n return result", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
121
|
+
{"id": "code-verifier/120", "task_id": "HumanEval/99", "entry_point": "closest_integer", "prompt": "\ndef closest_integer(value):\n '''\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n '''\n", "solution": "\ndef closest_integer(value):\n '''\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n '''\n d = Decimal(value)\n return int(d.to_integral_value(rounding=ROUND_HALF_UP))", "passes": false, "model": "minicpm5-2b-q8-bench", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
122
|
+
{"id": "code-verifier/121", "task_id": "HumanEval/124", "entry_point": "valid_date", "prompt": "\ndef valid_date(date):\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n for example: \n valid_date('03-11-2000') => True\n\n valid_date('15-01-2012') => False\n\n valid_date('04-0-2040') => False\n\n valid_date('06-04-2020') => True\n\n valid_date('06/04/2020') => False\n \"\"\"\n", "solution": "\ndef valid_date(date):\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n for example: \n valid_date('03-11-2000') => True\n\n valid_date('15-01-2012') => False\n\n valid_date('04-0-2040') => False\n\n valid_date('06-04-2020') => True\n\n valid_date('06/04/2020') => False\n \"\"\"\n if not date:\n return False\n\n if len(date) != 10 or date[2] != '-' or date[5] != '-':\n return False\n\n try:\n month = int(date[0:2])\n day = int(date[3:5])\n year = int(date[6:10])\n except ValueError:\n return False\n\n if not (1 <= month <= 12):\n return False\n\n if not (1 <= day <= 31):\n return False\n\n if month in [1, 3, 5, 7, 8, 10, 12]:\n if not (1 <= day <= 31):\n return False\n elif month in [4, 6, 9, 11]:\n if not (1 <= day <= 30):\n return False\n elif month == 2:\n if not (1 <= day <= 29):\n return False\n\n return True", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
123
|
+
{"id": "code-verifier/122", "task_id": "HumanEval/54", "entry_point": "same_chars", "prompt": "\n\ndef same_chars(s0: str, s1: str):\n \"\"\"\n Check if two words have the same characters.\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n True\n >>> same_chars('abcd', 'dddddddabc')\n True\n >>> same_chars('dddddddabc', 'abcd')\n True\n >>> same_chars('eabcd', 'dddddddabc')\n False\n >>> same_chars('abcd', 'dddddddabce')\n False\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n False\n \"\"\"\n", "solution": "def same_chars(s0: str, s1: str):\n return sorted(s0) == sorted(s1)", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
124
|
+
{"id": "code-verifier/123", "task_id": "HumanEval/55", "entry_point": "fib", "prompt": "\n\ndef fib(n: int):\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n", "solution": "\n\ndef fib(n: int):\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n a, b = 0, 1\n for _ in range(2, n + 1):\n a, b = b, a + b\n return b", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
125
|
+
{"id": "code-verifier/124", "task_id": "HumanEval/47", "entry_point": "median", "prompt": "\n\ndef median(l: list):\n \"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\n", "solution": "\n\ndef median(l: list):\n \"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\n s = sorted(l)\n n = len(s)\n if n % 2 == 1:\n return s[n // 2]\n else:\n return (s[n // 2] + s[n // 2 + 1]) / 2", "passes": false, "model": "qwen3.8-35b-a3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
126
|
+
{"id": "code-verifier/125", "task_id": "HumanEval/74", "entry_point": "total_match", "prompt": "\ndef total_match(lst1, lst2):\n '''\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n total_match([], []) ➞ []\n total_match(['hi', 'admin'], ['hI', 'Hi']) ➞ ['hI', 'Hi']\n total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) ➞ ['hi', 'admin']\n total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) ➞ ['hI', 'hi', 'hi']\n total_match(['4'], ['1', '2', '3', '4', '5']) ➞ ['4']\n '''\n", "solution": "def total_match(lst1, lst2):\n total1 = sum(len(s) for s in lst1)\n total2 = sum(len(s) for s in lst2)\n if total1 < total2:\n return lst1\n elif total2 < total1:\n return lst2\n else:\n return lst1", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
127
|
+
{"id": "code-verifier/126", "task_id": "HumanEval/91", "entry_point": "is_bored", "prompt": "\ndef is_bored(S):\n \"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored(\"Hello world\")\n 0\n >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n 1\n \"\"\"\n", "solution": "def is_bored(S):\n import re\n count = 0\n for sent in re.split(r'[.!?]', S):\n sent = sent.strip()\n if sent.startswith(\"I \") or sent == \"I\":\n count += 1\n return count", "passes": false, "model": "qwen3.6-35b-a3b-bench", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
128
|
+
{"id": "code-verifier/127", "task_id": "HumanEval/131", "entry_point": "digits", "prompt": "\ndef digits(n):\n \"\"\"Given a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n digits(1) == 1\n digits(4) == 0\n digits(235) == 15\n \"\"\"\n", "solution": "def digits(n):\n \"\"\"Given a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n digits(1) == 1\n digits(4) == 0\n digits(235) == 15\n \"\"\"\n result = 1\n has_odd = False\n while n:\n d = n % 10\n if d % 2 == 1:\n result *= d\n has_odd = True\n n //= 10\n return result if has_odd else 0", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
129
|
+
{"id": "code-verifier/128", "task_id": "HumanEval/26", "entry_point": "remove_duplicates", "prompt": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n", "solution": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n seen = set()\n result = []\n for num in numbers:\n if num not in seen:\n result.append(num)\n seen.add(num)\n return result", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
130
|
+
{"id": "code-verifier/129", "task_id": "HumanEval/104", "entry_point": "unique_digits", "prompt": "\ndef unique_digits(x):\n \"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n >>> unique_digits([152, 323, 1422, 10])\n []\n \"\"\"\n", "solution": "def unique_digits(x):\n \"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n \"\"\"\n def has_odd_digits(n):\n while n:\n d = n % 10\n if d % 2 == 0:\n return False\n n //= 10\n return True\n result = [num for num in x if has_odd_digits(num)]\n return sorted(result)", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
131
|
+
{"id": "code-verifier/130", "task_id": "HumanEval/163", "entry_point": "generate_integers", "prompt": "\ndef generate_integers(a, b):\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\n", "solution": "\ndef generate_integers(a, b):\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\n a, b = min(a, b), max(a, b)\n return [i for i in range(a, b + 1) if i % 2 == 0 and i < 10]", "passes": false, "model": "qwen3.8-27b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
132
|
+
{"id": "code-verifier/131", "task_id": "HumanEval/41", "entry_point": "car_race_collision", "prompt": "\n\ndef car_race_collision(n: int):\n \"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \"\"\"\n", "solution": "def car_race_collision(n: int):\n return n * n", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
133
|
+
{"id": "code-verifier/132", "task_id": "HumanEval/55", "entry_point": "fib", "prompt": "\n\ndef fib(n: int):\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n", "solution": "def fib(n: int):\n if n <= 0:\n raise ValueError(\"n must be positive\")\n a, b = 1, 1\n for _ in range(2, n+1):\n a, b = b, a + b\n return a", "passes": false, "model": "lfm2.5-8b-a1b-dspark", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
134
|
+
{"id": "code-verifier/133", "task_id": "HumanEval/151", "entry_point": "double_the_difference", "prompt": "\ndef double_the_difference(lst):\n '''\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n double_the_difference([-1, -2, 0]) == 0\n double_the_difference([9, -2]) == 81\n double_the_difference([0]) == 0 \n \n If the input list is empty, return 0.\n '''\n", "solution": "def double_the_difference(lst):\n total = 0\n for num in lst:\n if isinstance(num, int) and num >= 0 and num % 2 != 0:\n total += num * num\n return total", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
135
|
+
{"id": "code-verifier/134", "task_id": "HumanEval/93", "entry_point": "encode", "prompt": "\ndef encode(message):\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \"\"\"\n", "solution": "\ndef encode(message):\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \"\"\"\n result = []\n vowels = \"aeiouAEIOU\"\n for char in message:\n if char.isalpha():\n if char.islower():\n if char in vowels:\n next_char_code = ord(char) + 2\n if next_char_code <= ord('z'):\n result.append(chr(next_char_code))\n else:\n result.append(char)\n else:\n result.append(char.upper())\n else:\n if char in vowels:\n next_char_code = ord(char) + 2\n if next_char_code <= ord('Z'):\n result.append(chr(next_char_code))\n else:\n result.append(char)\n else:\n result.append(char.lower())\n else:\n result.append(char)\n return \"\".join(result)", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
136
|
+
{"id": "code-verifier/135", "task_id": "HumanEval/117", "entry_point": "select_words", "prompt": "\ndef select_words(s, n):\n \"\"\"Given a string s and a natural number n, you have been tasked to implement \n a function that returns a list of all words from string s that contain exactly \n n consonants, in order these words appear in the string s.\n If the string s is empty then the function should return an empty list.\n Note: you may assume the input string contains only letters and spaces.\n Examples:\n select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n select_words(\"simple white space\", 2) ==> []\n select_words(\"Hello world\", 4) ==> [\"world\"]\n select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\n \"\"\"\n", "solution": "def select_words(s, n):\n words = s.split()\n result = []\n for word in words:\n consonants = sum(1 for char in word if char.isalpha() and char.lower() not in 'aeiou')\n if consonants == n:\n result.append(word)\n return result", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
137
|
+
{"id": "code-verifier/136", "task_id": "HumanEval/76", "entry_point": "is_simple_power", "prompt": "\ndef is_simple_power(x, n):\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \"\"\"\n", "solution": "\ndef is_simple_power(x, n):\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \"\"\"\n if n == 1:\n return x == 1\n if x <= 0 or n <= 0:\n return False\n if x == 1:\n return True\n if n == 1:\n return x == 1\n if x < n:\n return False\n while x % n == 0:\n x //= n\n return x == 1", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
138
|
+
{"id": "code-verifier/137", "task_id": "HumanEval/154", "entry_point": "cycpattern_check", "prompt": "\ndef cycpattern_check(a , b):\n \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n cycpattern_check(\"abcd\",\"abd\") => False\n cycpattern_check(\"hello\",\"ell\") => True\n cycpattern_check(\"whassup\",\"psus\") => False\n cycpattern_check(\"abab\",\"baa\") => True\n cycpattern_check(\"efef\",\"eeff\") => False\n cycpattern_check(\"himenss\",\"simen\") => True\n\n \"\"\"\n", "solution": "def cycpattern_check(a, b):\n if len(b) > len(a):\n return False\n if not b:\n return True\n return any((b[i:] + b[:i]) in a for i in range(len(b)))", "passes": true, "model": "qwen3.8-27b-mtp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
139
|
+
{"id": "code-verifier/138", "task_id": "HumanEval/130", "entry_point": "tri", "prompt": "\ndef tri(n):\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\n", "solution": "def tri(n):\n if n == 0:\n return [3]\n if n == 1:\n return [3, 1 + 1 / 2]\n res = [3, 1 + 1 / 2]\n for i in range(2, n + 1):\n if i % 2 == 0:\n res.append(1 + i / 2)\n else:\n res.append(res[-1] + res[-2] + res[-3])\n return res", "passes": false, "model": "qwen3.8-27b-mtp-nothink", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
140
|
+
{"id": "code-verifier/139", "task_id": "HumanEval/142", "entry_point": "sum_squares", "prompt": "\n\n\ndef sum_squares(lst):\n \"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n For lst = [1,2,3] the output should be 6\n For lst = [] the output should be 0\n For lst = [-1,-5,2,-1,-5] the output should be -126\n \"\"\"\n", "solution": "def sum_squares(lst):\n total = 0\n for i, val in enumerate(lst):\n if i % 3 == 0:\n total += val ** 2\n elif i % 4 == 0 and i % 3 != 0:\n total += val ** 3\n else:\n total += val\n return total", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
141
|
+
{"id": "code-verifier/140", "task_id": "HumanEval/38", "entry_point": "decode_cyclic", "prompt": "\n\ndef encode_cyclic(s: str):\n \"\"\"\n returns encoded string by cycling groups of three characters.\n \"\"\"\n # split string to groups. Each of length 3.\n groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)]\n # cycle elements in each group. Unless group has fewer elements than 3.\n groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups]\n return \"\".join(groups)\n\n\ndef decode_cyclic(s: str):\n \"\"\"\n takes as input string encoded with encode_cyclic function. Returns decoded string.\n \"\"\"\n", "solution": "def decode_cyclic(s: str):\n \"\"\"\n takes as input string encoded with encode_cyclic function. Returns decoded string.\n \"\"\"\n # split string to groups. Each of length 3.\n groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)]\n # reverse the encoding by rotating each group right by one position\n decoded_groups = [group[-1] + group[:-1] for group in groups]\n return \"\".join(decoded_groups)", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
142
|
+
{"id": "code-verifier/141", "task_id": "HumanEval/136", "entry_point": "largest_smallest_integers", "prompt": "\ndef largest_smallest_integers(lst):\n '''\n Create a function that returns a tuple (a, b), where 'a' is\n the largest of negative integers, and 'b' is the smallest\n of positive integers in a list.\n If there is no negative or positive integers, return them as None.\n\n Examples:\n largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n largest_smallest_integers([]) == (None, None)\n largest_smallest_integers([0]) == (None, None)\n '''\n", "solution": "def largest_smallest_integers(lst):\n negatives = [x for x in lst if x < 0]\n positives = [x for x in lst if x > 0]\n a = max(negatives) if negatives else None\n b = min(positives) if positives else None\n return (a, b)", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
143
|
+
{"id": "code-verifier/142", "task_id": "HumanEval/100", "entry_point": "make_a_pile", "prompt": "\ndef make_a_pile(n):\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n", "solution": "def make_a_pile(n):\n result = []\n current = n\n for i in range(1, n + 1):\n if (n - i) % 2 == 0:\n result.append(current)\n else:\n current += 1\n result.append(current)\n return result", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
144
|
+
{"id": "code-verifier/143", "task_id": "HumanEval/144", "entry_point": "simplify", "prompt": "\ndef simplify(x, n):\n \"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n <numerator>/<denominator> where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n simplify(\"1/5\", \"5/1\") = True\n simplify(\"1/6\", \"2/1\") = False\n simplify(\"7/10\", \"10/2\") = False\n \"\"\"\n", "solution": "def simplify(x, n):\n num_x, den_x = x.split('/')\n num_n, den_n = n.split('/')\n num_x = int(num_x)\n den_x = int(den_x)\n num_n = int(num_n)\n den_n = int(den_n)\n return (num_x * num_n) % (den_x * den_n) == 0", "passes": true, "model": "muse-glimmer-30b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
145
|
+
{"id": "code-verifier/144", "task_id": "HumanEval/144", "entry_point": "simplify", "prompt": "\ndef simplify(x, n):\n \"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n <numerator>/<denominator> where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n simplify(\"1/5\", \"5/1\") = True\n simplify(\"1/6\", \"2/1\") = False\n simplify(\"7/10\", \"10/2\") = False\n \"\"\"\n", "solution": "def simplify(x, n):\n a, b = map(int, x.split('/'))\n c, d = map(int, n.split('/'))\n num = a * c\n den = b * d\n g = math.gcd(num, den)\n return den // g == 1", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
146
|
+
{"id": "code-verifier/145", "task_id": "HumanEval/140", "entry_point": "fix_spaces", "prompt": "\ndef fix_spaces(text):\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \"\"\"\n", "solution": "def fix_spaces(text):\n \"\"\"\n Given a string text, replace all spaces in it with underscores,\n and if a string has more than 2 consecutive spaces,\n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \"\"\"\n result = []\n i = 0\n n = len(text)\n while i < n:\n if text[i] == ' ':\n j = i\n while j < n and text[j] == ' ':\n j += 1\n run_len = j - i\n if run_len <= 2:\n result.append('_' * run_len)\n else:\n result.append('-')\n i = j\n else:\n result.append(text[i])\n i += 1\n return ''.join(result)", "passes": true, "model": "minicpm5-2b-q8-bench-rp110", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
147
|
+
{"id": "code-verifier/146", "task_id": "HumanEval/17", "entry_point": "parse_music", "prompt": "from typing import List\n\n\ndef parse_music(music_string: str) -> List[int]:\n \"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n \"\"\"\n", "solution": "from typing import List\n\n\ndef parse_music(music_string: str) -> List[int]:\n \"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n Your task is to parse this string and return list of integers corresponding to how many beats does each\n not last.\n\n Here is a legend:\n 'o' - whole note, lasts four beats\n 'o|' - half note, lasts two beats\n '.|' - quater note, lasts one beat\n\n >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n \"\"\"\n beats = []\n i = 0\n while i < len(music_string):\n char = music_string[i]\n if char == 'o':\n beats.append(4)\n i += 1\n elif char == 'o' and i + 1 < len(music_string) and music_string[i+1] == '|':\n beats.append(2)\n i += 2\n elif char == '.' and i + 1 < len(music_string) and music_string[i+1] == '|':\n beats.append(1)\n i += 2\n elif char == 'o' and i + 1 < len(music_string) and music_string[i+1] == ' ':\n # Handle 'o' followed by a space, which is a whole note\n beats.append(4)\n i += 1\n elif char == 'o' and i + 1 == len(music_string):\n # Handle 'o' at the end of the string\n beats.append(4)\n i += 1\n else:\n # Skip spaces or other unexpected characters\n i += 1\n return beats", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
148
|
+
{"id": "code-verifier/147", "task_id": "HumanEval/162", "entry_point": "string_to_md5", "prompt": "\ndef string_to_md5(text):\n \"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n \"\"\"\n", "solution": "def string_to_md5(text):\n if text == '':\n return None\n import hashlib\n return hashlib.md5(text.encode()).hexdigest()", "passes": true, "model": "minicpm5-2b-q4-bench-rp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
149
|
+
{"id": "code-verifier/148", "task_id": "HumanEval/120", "entry_point": "maximum", "prompt": "\ndef maximum(arr, k):\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n Input: arr = [-3, -4, 5], k = 3\n Output: [-4, -3, 5]\n\n Example 2:\n\n Input: arr = [4, -4, 4], k = 2\n Output: [4, 4]\n\n Example 3:\n\n Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n Output: [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n", "solution": "def maximum(arr, k):\n return sorted(arr, reverse=True)[:k]", "passes": false, "model": "qwen3.8-27b-mtp-nothink", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
150
|
+
{"id": "code-verifier/149", "task_id": "HumanEval/46", "entry_point": "fib4", "prompt": "\n\ndef fib4(n: int):\n \"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5)\n 4\n >>> fib4(6)\n 8\n >>> fib4(7)\n 14\n \"\"\"\n", "solution": "def fib4(n: int):\n if n == 0 or n == 1:\n return 0\n if n == 2:\n return 2\n if n == 3:\n return 0\n a, b, c, d = 0, 0, 2, 0\n for i in range(4, n + 1):\n a, b, c, d = b, c, d, a + b + c + d\n return d", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
151
|
+
{"id": "code-verifier/150", "task_id": "HumanEval/120", "entry_point": "maximum", "prompt": "\ndef maximum(arr, k):\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n Input: arr = [-3, -4, 5], k = 3\n Output: [-4, -3, 5]\n\n Example 2:\n\n Input: arr = [4, -4, 4], k = 2\n Output: [4, 4]\n\n Example 3:\n\n Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n Output: [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n", "solution": "\ndef maximum(arr, k):\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n Input: arr = [-3, -4, 5], k = 3\n Output: [-4, -3, 5]\n\n Example 2:\n\n Input: arr = [4, -4, 4], k = 2\n Output: [4, 4]\n\n Example 3:\n\n Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n Output: [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n return sorted(arr, reverse=True)[:k]", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
152
|
+
{"id": "code-verifier/151", "task_id": "HumanEval/84", "entry_point": "solve", "prompt": "\ndef solve(N):\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n For N = 1000, the sum of digits will be 1 the output should be \"1\".\n For N = 150, the sum of digits will be 6 the output should be \"110\".\n For N = 147, the sum of digits will be 12 the output should be \"1100\".\n \n Variables:\n @N integer\n Constraints: 0 ≤ N ≤ 10000.\n Output:\n a string of binary number\n \"\"\"\n", "solution": "def solve(N):\n s = sum(int(d) for d in str(N))\n return bin(s)[2:] if s else '0'", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
153
|
+
{"id": "code-verifier/152", "task_id": "HumanEval/103", "entry_point": "rounded_avg", "prompt": "\ndef rounded_avg(n, m):\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\n", "solution": "def rounded_avg(n, m):\n if n > m:\n return -1\n count = m - n + 1\n total = (n + m) * count // 2\n avg = total / count\n rounded = int(avg + 0.5)\n return '0b' + bin(rounded)", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
154
|
+
{"id": "code-verifier/153", "task_id": "HumanEval/11", "entry_point": "string_xor", "prompt": "from typing import List\n\n\ndef string_xor(a: str, b: str) -> str:\n \"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor('010', '110')\n '100'\n \"\"\"\n", "solution": "from typing import List\n\n\ndef string_xor(a: str, b: str) -> str:\n \"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor('010', '110')\n '100'\n \"\"\"\n result = []\n for i in range(len(a)):\n if a[i] != b[i]:\n result.append('1')\n else:\n result.append('0')\n return \"\".join(result)", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
155
|
+
{"id": "code-verifier/154", "task_id": "HumanEval/132", "entry_point": "is_nested", "prompt": "\ndef is_nested(string):\n '''\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n is_nested('[[]]') ➞ True\n is_nested('[]]]]]]][[[[[]') ➞ False\n is_nested('[][]') ➞ False\n is_nested('[]') ➞ False\n is_nested('[[][]]') ➞ True\n is_nested('[[]][[') ➞ True\n '''\n", "solution": "def is_nested(string):\n stack = []\n max_depth = 0\n for c in string:\n if c == '[':\n stack.append(c)\n max_depth = max(max_depth, len(stack))\n elif c == ']':\n if stack:\n stack.pop()\n if not stack:\n if max_depth >= 2:\n return True\n max_depth = 0\n return False", "passes": false, "model": "qwen3.8-27b-q4-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
156
|
+
{"id": "code-verifier/155", "task_id": "HumanEval/48", "entry_point": "is_palindrome", "prompt": "\n\ndef is_palindrome(text: str):\n \"\"\"\n Checks if given string is a palindrome\n >>> is_palindrome('')\n True\n >>> is_palindrome('aba')\n True\n >>> is_palindrome('aaaaa')\n True\n >>> is_palindrome('zbcd')\n False\n \"\"\"\n", "solution": "def is_palindrome(text: str):\n return text == text[::-1]", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
157
|
+
{"id": "code-verifier/156", "task_id": "HumanEval/49", "entry_point": "modp", "prompt": "\n\ndef modp(n: int, p: int):\n \"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\n", "solution": "\n\ndef modp(n: int, p: int):\n \"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\n if n == 0:\n return 1\n\n result = 1\n base = 2 % p\n exponent = n\n while exponent > 0:\n if exponent % 2 == 1:\n result = (result * base) % p\n base = (base * base) % p\n exponent //= 2\n return result", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
158
|
+
{"id": "code-verifier/157", "task_id": "HumanEval/124", "entry_point": "valid_date", "prompt": "\ndef valid_date(date):\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n for example: \n valid_date('03-11-2000') => True\n\n valid_date('15-01-2012') => False\n\n valid_date('04-0-2040') => False\n\n valid_date('06-04-2020') => True\n\n valid_date('06/04/2020') => False\n \"\"\"\n", "solution": "\ndef valid_date(date):\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n for example: \n valid_date('03-11-2000') => True\n\n valid_date('15-01-2012') => False\n\n valid_date('04-0-2040') => False\n\n valid_date('06-04-2020') => True\n\n valid_date('06/04/2020') => False\n \"\"\"\n if not date:\n return False\n parts = date.split('-')\n if len(parts) != 3:\n return False\n mm, dd, yyyy = parts\n if not (mm.isdigit() and dd.isdigit() and yyyy.isdigit()):\n return False\n if len(mm) != 2 or len(dd) != 2 or len(yyyy) != 4:\n return False\n month = int(mm)\n day = int(dd)\n if month < 1 or month > 12:\n return False\n if month == 2:\n if day < 1 or day > 29:\n return False\n elif month in (4, 6, 9, 11):\n if day < 1 or day > 30:\n return False\n else:\n if day < 1 or day > 31:\n return False\n return True", "passes": true, "model": "qwen3.8-27b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
159
|
+
{"id": "code-verifier/158", "task_id": "HumanEval/129", "entry_point": "minPath", "prompt": "\ndef minPath(grid, k):\n \"\"\"\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples:\n\n Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n Output: [1, 2, 1]\n\n Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n Output: [1]\n \"\"\"\n", "solution": "def minPath(grid, k):\n N = len(grid)\n min_path_values = None\n\n def is_valid(r, c):\n return 0 <= r < N and 0 <= c < N\n\n def get_neighbors(r, c):\n neighbors = []\n for dr, dc in [(0, 1), (0, -1), (1, 0), (-1, 0)]:\n nr, nc = r + dr, c + dc\n if is_valid(nr, nc):\n neighbors.append((nr, nc))\n return neighbors\n\n def compare_paths(path1, path2):\n for i in range(len(path1)):\n if path1[i] < path2[i]:\n return True # path1 is lexicographically smaller\n if path1[i] > path2[i]:\n return False # path2 is lexicographically smaller\n return False # paths are equal (should not happen based on problem statement)\n\n for start_r in range(N):\n for start_c in range(N):\n # DFS to find all paths of length k starting from (start_r, start_c)\n stack = [(start_r, start_c, [grid[start_r][start_c]])]\n\n while stack:\n r, c, current_path = stack.pop()\n\n if len(current_path) == k:\n if min_path_values is None or compare_paths(current_path, min_path_values):\n min_path_values = list(current_path)\n continue\n\n # Explore neighbors for the next step\n for nr, nc in get_neighbors(r, c):\n new_path = current_path + [grid[nr][nc]]\n stack.append((nr, nc, new_path))\n\n return min_path_values", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
160
|
+
{"id": "code-verifier/159", "task_id": "HumanEval/25", "entry_point": "factorize", "prompt": "from typing import List\n\n\ndef factorize(n: int) -> List[int]:\n \"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8)\n [2, 2, 2]\n >>> factorize(25)\n [5, 5]\n >>> factorize(70)\n [2, 5, 7]\n \"\"\"\n", "solution": "from typing import List\n\n\ndef factorize(n: int) -> List[int]:\n \"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n Input number should be equal to the product of all factors\n >>> factorize(8)\n [2, 2, 2]\n >>> factorize(25)\n [5, 5]\n >>> factorize(70)\n [2, 5, 7]\n \"\"\"\n if n <= 1:\n return []\n factors = []\n d = 2\n temp_n = n\n while d * d <= temp_n:\n while temp_n % d == 0:\n factors.append(d)\n temp_n //= d\n d += 1\n if temp_n > 1:\n factors.append(temp_n)\n return factors", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
161
|
+
{"id": "code-verifier/160", "task_id": "HumanEval/54", "entry_point": "same_chars", "prompt": "\n\ndef same_chars(s0: str, s1: str):\n \"\"\"\n Check if two words have the same characters.\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n True\n >>> same_chars('abcd', 'dddddddabc')\n True\n >>> same_chars('dddddddabc', 'abcd')\n True\n >>> same_chars('eabcd', 'dddddddabc')\n False\n >>> same_chars('abcd', 'dddddddabce')\n False\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n False\n \"\"\"\n", "solution": "\n\ndef same_chars(s0: str, s1: str):\n \"\"\"\n Check if two words have the same characters.\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n True\n >>> same_chars('abcd', 'dddddddabc')\n True\n >>> same_chars('dddddddabc', 'abcd')\n True\n >>> same_chars('eabcd', 'dddddddabc')\n False\n >>> same_chars('abcd', 'dddddddabce')\n False\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n False\n \"\"\"\n return sorted(s0) == sorted(s1)", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
162
|
+
{"id": "code-verifier/161", "task_id": "HumanEval/122", "entry_point": "add_elements", "prompt": "\ndef add_elements(arr, k):\n \"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n Output: 24 # sum of 21 + 3\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\n", "solution": "def add_elements(arr, k):\n total = 0\n for i in range(min(k, len(arr))):\n num = arr[i]\n if abs(num) < 100:\n total += num\n return total", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
163
|
+
{"id": "code-verifier/162", "task_id": "HumanEval/118", "entry_point": "get_closest_vowel", "prompt": "\ndef get_closest_vowel(word):\n \"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n get_closest_vowel(\"yogurt\") ==> \"u\"\n get_closest_vowel(\"FULL\") ==> \"U\"\n get_closest_vowel(\"quick\") ==> \"\"\n get_closest_vowel(\"ab\") ==> \"\"\n \"\"\"\n", "solution": "def get_closest_vowel(word):\n vowels = set('aeiou')\n for i in range(len(word)-2, 0, -1):\n if word[i] in vowels and word[i-1] not in vowels and word[i+1] not in vowels:\n return word[i]\n return ''", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
164
|
+
{"id": "code-verifier/163", "task_id": "HumanEval/105", "entry_point": "by_length", "prompt": "\ndef by_length(arr):\n \"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n arr = [2, 1, 1, 4, 5, 8, 2, 3] \n -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the array is empty, return an empty array:\n arr = []\n return []\n \n If the array has any strange number ignore it:\n arr = [1, -1 , 55] \n -> sort arr -> [-1, 1, 55]\n -> reverse arr -> [55, 1, -1]\n return = ['One']\n \"\"\"\n", "solution": "def by_length(arr):\n \"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n arr = [2, 1, 1, 4, 5, 8, 2, 3] \n -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the array is empty, return an empty array:\n arr = []\n return []\n \n If the array has any strange number ignore it:\n arr = [1, -1 , 55] \n -> sort arr -> [-1, 1, 55]\n -> reverse arr -> [55, 1, -1]\n return = ['One']\n \"\"\"\n mapping = {1: \"One\", 2: \"Two\", 3: \"Three\", 4: \"Four\", 5: \"Five\", 6: \"Six\", 7: \"Seven\", 8: \"Eight\", 9: \"Nine\"}\n valid = [x for x in arr if 1 <= x <= 9]\n if not valid:\n return []\n sorted_valid = sorted(valid)\n reversed_sorted = sorted_valid[::-1]\n return [mapping[x] for x in reversed_sorted]", "passes": true, "model": "minicpm5-2b-q8-bench-rp105", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
165
|
+
{"id": "code-verifier/164", "task_id": "HumanEval/33", "entry_point": "sort_third", "prompt": "\n\ndef sort_third(l: list):\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n >>> sort_third([1, 2, 3])\n [1, 2, 3]\n >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n [2, 6, 3, 4, 8, 9, 5]\n \"\"\"\n", "solution": "def sort_third(l: list):\n indices = [i for i in range(len(l)) if i % 3 == 0]\n values_at_indices = [l[i] for i in indices]\n values_at_indices.sort()\n result = l.copy()\n result[indices] = values_at_indices\n return result", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
166
|
+
{"id": "code-verifier/165", "task_id": "HumanEval/103", "entry_point": "rounded_avg", "prompt": "\ndef rounded_avg(n, m):\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\n", "solution": "\ndef rounded_avg(n, m):\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\n if n > m:\n return -1\n else:\n # Calculate the sum of integers from n to m\n # The number of terms is m - n + 1\n # The sum of an arithmetic progression is (number of terms / 2) * (first term + last term)\n count = m - n + 1\n sum_val = (count * (n + m)) // 2\n\n # Calculate the average\n average = sum_val / count\n\n # Round the average to the nearest integer\n rounded_avg_int = int(round(average))\n\n # Convert the integer to its binary representation\n binary_representation = bin(rounded_avg_int)\n\n # Return the binary string, prefixed with \"0b\"\n return binary_representation", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
167
|
+
{"id": "code-verifier/166", "task_id": "HumanEval/122", "entry_point": "add_elements", "prompt": "\ndef add_elements(arr, k):\n \"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n Output: 24 # sum of 21 + 3\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\n", "solution": "def add_elements(arr, k):\n total = 0\n for i in range(k):\n num = arr[i]\n if 10 <= num < 100:\n total += num\n return total", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
168
|
+
{"id": "code-verifier/167", "task_id": "HumanEval/144", "entry_point": "simplify", "prompt": "\ndef simplify(x, n):\n \"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n <numerator>/<denominator> where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n simplify(\"1/5\", \"5/1\") = True\n simplify(\"1/6\", \"2/1\") = False\n simplify(\"7/10\", \"10/2\") = False\n \"\"\"\n", "solution": "def simplify(x, n):\n a,b=map(int,x.split('/'))\n c,d=map(int,n.split('/'))\n return (a*c) % (b*d) == 0", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
169
|
+
{"id": "code-verifier/168", "task_id": "HumanEval/80", "entry_point": "is_happy", "prompt": "\ndef is_happy(s):\n \"\"\"You are given a string s.\n Your task is to check if the string is happy or not.\n A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n For example:\n is_happy(a) => False\n is_happy(aa) => False\n is_happy(abcd) => True\n is_happy(aabb) => False\n is_happy(adb) => True\n is_happy(xyy) => False\n \"\"\"\n", "solution": "def is_happy(s):\n if len(s) < 3:\n return False\n for i in range(len(s)-2):\n if s[i] == s[i+1] or s[i] == s[i+2]:\n return False\n return True", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
170
|
+
{"id": "code-verifier/169", "task_id": "HumanEval/6", "entry_point": "parse_nested_parens", "prompt": "from typing import List\n\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n \"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens('(()()) ((())) () ((())()())')\n [2, 3, 1, 3]\n \"\"\"\n", "solution": "from typing import List\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n groups = paren_string.split()\n result = []\n for group in groups:\n depth = 0\n max_depth = 0\n for ch in group:\n if ch == '(':\n depth += 1\n max_depth = max(max_depth, depth)\n elif ch == ')':\n depth -= 1\n result.append(max_depth)\n return result", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
171
|
+
{"id": "code-verifier/170", "task_id": "HumanEval/9", "entry_point": "rolling_max", "prompt": "from typing import List, Tuple\n\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\n", "solution": "from typing import List, Tuple\n\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\n result = []\n current_max = numbers[0]\n for num in numbers:\n if num > current_max:\n current_max = num\n result.append(current_max)\n return result", "passes": false, "model": "qwen3.8-27b-mtp-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
172
|
+
{"id": "code-verifier/171", "task_id": "HumanEval/138", "entry_point": "is_equal_to_sum_even", "prompt": "\ndef is_equal_to_sum_even(n):\n \"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n is_equal_to_sum_even(4) == False\n is_equal_to_sum_even(6) == False\n is_equal_to_sum_even(8) == True\n \"\"\"\n", "solution": "def is_equal_to_sum_even(n):\n if n % 2 != 0 or n < 8:\n return False\n return n // 2 >= 4", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
173
|
+
{"id": "code-verifier/172", "task_id": "HumanEval/90", "entry_point": "next_smallest", "prompt": "\ndef next_smallest(lst):\n \"\"\"\n You are given a list of integers.\n Write a function next_smallest() that returns the 2nd smallest element of the list.\n Return None if there is no such element.\n \n next_smallest([1, 2, 3, 4, 5]) == 2\n next_smallest([5, 1, 4, 3, 2]) == 2\n next_smallest([]) == None\n next_smallest([1, 1]) == None\n \"\"\"\n", "solution": "def next_smallest(lst):\n if len(lst) < 2:\n return None\n sorted_lst = sorted(lst)\n if sorted_lst[0] == sorted_lst[1]:\n return None\n return sorted_lst[1]", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
174
|
+
{"id": "code-verifier/173", "task_id": "HumanEval/101", "entry_point": "words_string", "prompt": "\ndef words_string(s):\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n", "solution": "\ndef words_string(s):\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n return s.replace(\",\", \" \").split()", "passes": true, "model": "bonsai2-27b-pq2-np4", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
175
|
+
{"id": "code-verifier/174", "task_id": "HumanEval/10", "entry_point": "make_palindrome", "prompt": "\n\ndef is_palindrome(string: str) -> bool:\n \"\"\" Test if given string is a palindrome \"\"\"\n return string == string[::-1]\n\n\ndef make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n", "solution": "def make_palindrome(string: str) -> str:\n n = len(string)\n for i in range(n // 2, -1, -1):\n if string[i:] == string[i:][::-1]:\n return string + string[:i][::-1]\n return string + string[::-1]", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
176
|
+
{"id": "code-verifier/175", "task_id": "HumanEval/153", "entry_point": "Strongest_Extension", "prompt": "\ndef Strongest_Extension(class_name, extensions):\n \"\"\"You will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\n \"\"\"\n", "solution": "\ndef Strongest_Extension(class_name, extensions):\n \"\"\"You will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\n \"\"\"\n best_extension = None\n max_strength = -float('inf')\n\n for extension in extensions:\n cap = sum(1 for char in extension if char.isupper())\n sm = sum(1 for char in extension if char.islower())\n strength = cap - sm\n\n if strength > max_strength:\n max_strength = strength\n best_extension = extension\n\n if best_extension is not None:\n return f\"{class_name}.{best_extension}\"\n else:\n # This case should ideally not happen if extensions is not empty,\n # but as a fallback, we might return just the class name or handle error.\n # Based on the problem description, we assume extensions is non-empty.\n return class_name", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
177
|
+
{"id": "code-verifier/176", "task_id": "HumanEval/141", "entry_point": "file_name_check", "prompt": "\ndef file_name_check(file_name):\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n file_name_check(\"example.txt\") # => 'Yes'\n file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n \"\"\"\n", "solution": "def file_name_check(file_name):\n if file_name.count('.') != 1:\n return 'No'\n \n parts = file_name.split('.')\n before_dot = parts[0]\n after_dot = parts[1]\n \n if len(before_dot) == 0:\n return 'No'\n \n first_char = before_dot[0]\n if not (('a' <= first_char <= 'z') or ('A' <= first_char <= 'Z')):\n return 'No'\n \n if after_dot not in ['txt', 'exe', 'dll']:\n return 'No'\n \n digit_count = sum(1 for c in file_name if c.isdigit())\n if digit_count > 3:\n return 'No'\n \n return 'Yes'", "passes": false, "model": "qwen3.8-27b-mtp-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
178
|
+
{"id": "code-verifier/177", "task_id": "HumanEval/120", "entry_point": "maximum", "prompt": "\ndef maximum(arr, k):\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n Input: arr = [-3, -4, 5], k = 3\n Output: [-4, -3, 5]\n\n Example 2:\n\n Input: arr = [4, -4, 4], k = 2\n Output: [4, 4]\n\n Example 3:\n\n Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n Output: [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n", "solution": "def maximum(arr, k):\n if k == 0:\n return []\n import heapq\n largest = heapq.nlargest(k, arr)\n return sorted(largest)", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
179
|
+
{"id": "code-verifier/178", "task_id": "HumanEval/102", "entry_point": "choose_num", "prompt": "\ndef choose_num(x, y):\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n", "solution": "def choose_num(x, y):\n low = min(x, y)\n high = max(x, y)\n candidate = high if high % 2 == 0 else high - 1\n return candidate if candidate >= low else -1", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
180
|
+
{"id": "code-verifier/179", "task_id": "HumanEval/163", "entry_point": "generate_integers", "prompt": "\ndef generate_integers(a, b):\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\n", "solution": "def generate_integers(a, b):\n low = min(a, b)\n high = max(a, b)\n even_digits = [2, 4, 6, 8]\n return [d for d in even_digits if low <= d <= high]", "passes": true, "model": "spark-x2.5-4b-bench-rp105", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
181
|
+
{"id": "code-verifier/180", "task_id": "HumanEval/132", "entry_point": "is_nested", "prompt": "\ndef is_nested(string):\n '''\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n is_nested('[[]]') ➞ True\n is_nested('[]]]]]]][[[[[]') ➞ False\n is_nested('[][]') ➞ False\n is_nested('[]') ➞ False\n is_nested('[[][]]') ➞ True\n is_nested('[[]][[') ➞ True\n '''\n", "solution": "\ndef is_nested(string):\n '''\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n is_nested('[[]]') ➞ True\n is_nested('[]]]]]]][[[[[]') ➞ False\n is_nested('[][]') ➞ False\n is_nested('[]') ➞ False\n is_nested('[[][]]') ➞ True\n is_nested('[[]][[') ➞ True\n '''\n count_open = 0\n second_open_index = -1\n for i, c in enumerate(string):\n if c == '[':\n count_open += 1\n if count_open == 2:\n second_open_index = i\n break\n if second_open_index == -1:\n return False\n closing = sum(1 for c in string[second_open_index + 1:] if c == ']')\n return closing >= 2", "passes": false, "model": "ornith-35b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
182
|
+
{"id": "code-verifier/181", "task_id": "HumanEval/134", "entry_point": "check_if_last_char_is_a_letter", "prompt": "\ndef check_if_last_char_is_a_letter(txt):\n '''\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") ➞ False\n check_if_last_char_is_a_letter(\"apple pi e\") ➞ True\n check_if_last_char_is_a_letter(\"apple pi e \") ➞ False\n check_if_last_char_is_a_letter(\"\") ➞ False \n '''\n", "solution": "\ndef check_if_last_char_is_a_letter(txt):\n '''\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") ➞ False\n check_if_last_char_is_a_letter(\"apple pi e\") ➞ True\n check_if_last_char_is_a_letter(\"apple pi e \") ➞ False\n check_if_last_char_is_a_letter(\"\") ➞ False \n '''\n if not txt or not txt[-1].isalpha():\n return False\n return len(txt) == 1 or txt[-2] == ' '", "passes": true, "model": "qwen3.8-27b-q4-xhigh", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
183
|
+
{"id": "code-verifier/182", "task_id": "HumanEval/68", "entry_point": "pluck", "prompt": "\ndef pluck(arr):\n \"\"\"\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n Input: [4,2,3]\n Output: [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n Input: [1,2,3]\n Output: [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index. \n\n Example 3:\n Input: []\n Output: []\n \n Example 4:\n Input: [5, 0, 3, 0, 4, 2]\n Output: [0, 1]\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \"\"\"\n", "solution": "def pluck(arr):\n smallest_even = float('inf')\n result = []\n for i, val in enumerate(arr):\n if val % 2 == 0 and val < smallest_even:\n smallest_even = val\n result = [val, i]\n elif val % 2 == 0 and val == smallest_even:\n if i < len(result) or (i < len(result[0]) and arr[i] < result[1]):\n result = [val, i]\n return result if result else []", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
184
|
+
{"id": "code-verifier/183", "task_id": "HumanEval/135", "entry_point": "can_arrange", "prompt": "\ndef can_arrange(arr):\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \"\"\"\n", "solution": "def can_arrange(arr):\n for i in range(len(arr)-1, 0, -1):\n if arr[i] <= arr[i-1]:\n return i\n return -1", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
185
|
+
{"id": "code-verifier/184", "task_id": "HumanEval/118", "entry_point": "get_closest_vowel", "prompt": "\ndef get_closest_vowel(word):\n \"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n get_closest_vowel(\"yogurt\") ==> \"u\"\n get_closest_vowel(\"FULL\") ==> \"U\"\n get_closest_vowel(\"quick\") ==> \"\"\n get_closest_vowel(\"ab\") ==> \"\"\n \"\"\"\n", "solution": "def get_closest_vowel(word):\n vowels = set('aeiouAEIOU')\n n = len(word)\n for i in range(n - 2, -1, -1):\n if word[i] in vowels and word[i + 1] not in vowels and word[i - 1] not in vowels:\n return word[i]\n return ''", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
186
|
+
{"id": "code-verifier/185", "task_id": "HumanEval/68", "entry_point": "pluck", "prompt": "\ndef pluck(arr):\n \"\"\"\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n Input: [4,2,3]\n Output: [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n Input: [1,2,3]\n Output: [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index. \n\n Example 3:\n Input: []\n Output: []\n \n Example 4:\n Input: [5, 0, 3, 0, 4, 2]\n Output: [0, 1]\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \"\"\"\n", "solution": "\ndef pluck(arr):\n \"\"\"\n \"Given an array representing a branch of a tree that has non-negative integer nodes\n your task is to pluck one of the nodes and return it.\n The plucked node should be the node with the smallest even value.\n If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n The plucked node should be returned in a list, [ smalest_value, its index ],\n If there are no even values or the given array is empty, return [].\n\n Example 1:\n Input: [4,2,3]\n Output: [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n Example 2:\n Input: [1,2,3]\n Output: [2, 1]\n Explanation: 2 has the smallest even value, and 2 has the smallest index. \n\n Example 3:\n Input: []\n Output: []\n \n Example 4:\n Input: [5, 0, 3, 0, 4, 2]\n Output: [0, 1]\n Explanation: 0 is the smallest value, but there are two zeros,\n so we will choose the first zero, which has the smallest index.\n\n Constraints:\n * 1 <= nodes.length <= 10000\n * 0 <= node.value\n \"\"\"\n if not arr:\n return []\n\n smallest_even_value = float('inf')\n smallest_even_index = -1\n\n for i, value in enumerate(arr):\n if value % 2 == 0:\n if value < smallest_even_value:\n smallest_even_value = value\n smallest_even_index = i\n elif value == smallest_even_value:\n # If values are equal, we prefer the smaller index.\n # Since we iterate in increasing order of index (i),\n # the first time we set smallest_even_index for a given smallest_even_value,\n # it will automatically have the smallest index for that value.\n # So, we only need to update if the value is strictly smaller.\n pass\n\n if smallest_even_index == -1:\n return []\n else:\n return [smallest_even_value, smallest_even_index]", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
187
|
+
{"id": "code-verifier/186", "task_id": "HumanEval/108", "entry_point": "count_nums", "prompt": "\ndef count_nums(arr):\n \"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n \"\"\"\n", "solution": "def count_nums(arr):\n count = 0\n for num in arr:\n if any(int(digit) > 0 for digit in str(abs(num))):\n count += 1\n return count", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
188
|
+
{"id": "code-verifier/187", "task_id": "HumanEval/26", "entry_point": "remove_duplicates", "prompt": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n", "solution": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n counts = {}\n for number in numbers:\n counts[number] = counts.get(number, 0) + 1\n return [number for number in numbers if counts[number] == 1]", "passes": true, "model": "qwen3.8-27b-q4-xhigh", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
189
|
+
{"id": "code-verifier/188", "task_id": "HumanEval/6", "entry_point": "parse_nested_parens", "prompt": "from typing import List\n\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n \"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens('(()()) ((())) () ((())()())')\n [2, 3, 1, 3]\n \"\"\"\n", "solution": "from typing import List\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n result = []\n current_depth = 0\n for char in paren_string:\n if char == '(':\n current_depth += 1\n elif char == ')':\n current_depth -= 1\n # Track the maximum depth reached so far (only when we are inside parentheses)\n if current_depth > max_depth:\n max_depth = current_depth\n return [max_depth] * paren_string.count(' ')", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
190
|
+
{"id": "code-verifier/189", "task_id": "HumanEval/81", "entry_point": "numerical_letter_grade", "prompt": "\ndef numerical_letter_grade(grades):\n \"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n \"\"\"\n", "solution": "def numerical_letter_grade(grades):\n result = []\n for g in grades:\n if g >= 4.0:\n result.append('A+')\n elif g > 3.7:\n result.append('A')\n elif g > 3.3:\n result.append('A-')\n elif g > 3.0:\n result.append('B+')\n elif g > 2.7:\n result.append('B')\n elif g > 2.3:\n result.append('B-')\n elif g > 2.0:\n result.append('C+')\n elif g > 1.7:\n result.append('C')\n elif g > 1.3:\n result.append('C-')\n elif g > 1.0:\n result.append('D+')\n elif g > 0.7:\n result.append('D')\n elif g > 0.0:\n result.append('D-')\n else:\n result.append('E')\n return result", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
191
|
+
{"id": "code-verifier/190", "task_id": "HumanEval/48", "entry_point": "is_palindrome", "prompt": "\n\ndef is_palindrome(text: str):\n \"\"\"\n Checks if given string is a palindrome\n >>> is_palindrome('')\n True\n >>> is_palindrome('aba')\n True\n >>> is_palindrome('aaaaa')\n True\n >>> is_palindrome('zbcd')\n False\n \"\"\"\n", "solution": "def is_palindrome(text: str):\n \"\"\"\n Checks if given string is a palindrome\n >>> is_palindrome('')\n True\n >>> is_palindrome('aba')\n True\n >>> is_palindrome('aaaaa')\n True\n >>> is_palindrome('zbcd')\n False\n \"\"\"\n cleaned = ''.join(c.lower() for c in text if c.isalnum())\n return cleaned == cleaned[::-1]", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
192
|
+
{"id": "code-verifier/191", "task_id": "HumanEval/118", "entry_point": "get_closest_vowel", "prompt": "\ndef get_closest_vowel(word):\n \"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n get_closest_vowel(\"yogurt\") ==> \"u\"\n get_closest_vowel(\"FULL\") ==> \"U\"\n get_closest_vowel(\"quick\") ==> \"\"\n get_closest_vowel(\"ab\") ==> \"\"\n \"\"\"\n", "solution": "def get_closest_vowel(word):\n vowels = \"aeiouAEIOU\"\n for i in range(len(word) - 2, 0, -1):\n if word[i] in vowels and word[i-1] not in vowels and word[i+1] not in vowels:\n return word[i]\n return \"\"", "passes": true, "model": "qwen3.8-27b-q4-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
193
|
+
{"id": "code-verifier/192", "task_id": "HumanEval/145", "entry_point": "order_by_points", "prompt": "\ndef order_by_points(nums):\n \"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n >>> order_by_points([]) == []\n \"\"\"\n", "solution": "\ndef order_by_points(nums):\n \"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n >>> order_by_points([]) == []\n \"\"\"\n return sorted(nums, key=lambda x: (sum(int(d) for d in str(abs(x))) - (1 if x < 0 else 0), x))", "passes": false, "model": "qwen3.8-27b-q4-xhigh", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
194
|
+
{"id": "code-verifier/193", "task_id": "HumanEval/95", "entry_point": "check_dict_case", "prompt": "\ndef check_dict_case(dict):\n \"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n check_dict_case({\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}) should return False.\n check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n \"\"\"\n", "solution": "\ndef check_dict_case(dict):\n \"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n check_dict_case({\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}) should return False.\n check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n \"\"\"\n if not dict:\n return False\n\n keys = list(dict.keys())\n\n if not keys:\n return False\n\n first_key = keys[0]\n is_first_lower = first_key.islower()\n is_first_upper = first_key.isupper()\n\n if not (is_first_lower or is_first_upper):\n return False\n\n all_lower = all(key.islower() for key in keys)\n all_upper = all(key.isupper() for key in keys)\n\n return all_lower or all_upper", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
195
|
+
{"id": "code-verifier/194", "task_id": "HumanEval/132", "entry_point": "is_nested", "prompt": "\ndef is_nested(string):\n '''\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n is_nested('[[]]') ➞ True\n is_nested('[]]]]]]][[[[[]') ➞ False\n is_nested('[][]') ➞ False\n is_nested('[]') ➞ False\n is_nested('[[][]]') ➞ True\n is_nested('[[]][[') ➞ True\n '''\n", "solution": "\ndef is_nested(string):\n '''\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n is_nested('[[]]') ➞ True\n is_nested('[]]]]]]][[[[[]') ➞ False\n is_nested('[][]') ➞ False\n is_nested('[]') ➞ False\n is_nested('[[][]]') ➞ True\n is_nested('[[]][[') ➞ True\n '''\n opens = 0\n closes = 0\n for ch in string:\n if ch == '[':\n opens += 1\n elif ch == ']':\n if opens >= 2:\n closes += 1\n if closes >= 2:\n return True\n return False", "passes": false, "model": "qwen3.8-27b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
196
|
+
{"id": "code-verifier/195", "task_id": "HumanEval/76", "entry_point": "is_simple_power", "prompt": "\ndef is_simple_power(x, n):\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \"\"\"\n", "solution": "def is_simple_power(x, n):\n if x == 1:\n return True\n if n == 1:\n return False\n if n == 0:\n return x == 0\n if x == 0:\n return False\n while x % n == 0:\n x = x // n\n return x == 1", "passes": true, "model": "qwen3.8-27b-q4-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
197
|
+
{"id": "code-verifier/196", "task_id": "HumanEval/6", "entry_point": "parse_nested_parens", "prompt": "from typing import List\n\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n \"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens('(()()) ((())) () ((())()())')\n [2, 3, 1, 3]\n \"\"\"\n", "solution": "from typing import List\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n results = []\n groups = paren_string.split(' ')\n for group in groups:\n max_depth = 0\n current_depth = 0\n for char in group:\n if char == '(':\n current_depth += 1\n if current_depth > max_depth:\n max_depth = current_depth\n elif char == ')':\n current_depth -= 1\n results.append(max_depth)\n return results", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
198
|
+
{"id": "code-verifier/197", "task_id": "HumanEval/120", "entry_point": "maximum", "prompt": "\ndef maximum(arr, k):\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n Input: arr = [-3, -4, 5], k = 3\n Output: [-4, -3, 5]\n\n Example 2:\n\n Input: arr = [4, -4, 4], k = 2\n Output: [4, 4]\n\n Example 3:\n\n Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n Output: [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n", "solution": "def maximum(arr, k):\n if k == 0:\n return []\n return sorted(arr)[-k:]", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
199
|
+
{"id": "code-verifier/198", "task_id": "HumanEval/147", "entry_point": "get_max_triples", "prompt": "\ndef get_max_triples(n):\n \"\"\"\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 ≤ i ≤ n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n Input: n = 5\n Output: 1\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \"\"\"\n", "solution": "def get_max_triples(n):\n total = n * (n - 1) // 2\n mod_counts = [0] * 3\n for i in range(1, n + 1):\n val = i * i - i + 1\n mod_counts[val % 3] += 1\n count = 0\n # Triples where all three have the same remainder: C(cnt, 3)\n for c in mod_counts:\n if c >= 3:\n count += c * (c - 1) * (c - 2) // 6\n # Triples with two of one remainder and one of another: 3 * cnt[rem] * sum_{r != rem} cnt[r]\n for r in range(3):\n other_sum = total - mod_counts[r]\n count += mod_counts[r] * other_sum\n return count", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
200
|
+
{"id": "code-verifier/199", "task_id": "HumanEval/110", "entry_point": "exchange", "prompt": "\ndef exchange(lst1, lst2):\n \"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n It is assumed that the input lists will be non-empty.\n \"\"\"\n", "solution": "def exchange(lst1, lst2):\n odd_in_lst1 = sum(1 for x in lst1 if x % 2 != 0)\n even_in_lst2 = sum(1 for x in lst2 if x % 2 == 0)\n return \"YES\" if odd_in_lst1 <= even_in_lst2 else \"NO\"", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
201
|
+
{"id": "code-verifier/200", "task_id": "HumanEval/140", "entry_point": "fix_spaces", "prompt": "\ndef fix_spaces(text):\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \"\"\"\n", "solution": "\ndef fix_spaces(text):\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \"\"\"\n result = []\n count = 0\n for ch in text:\n if ch == ' ':\n count += 1\n else:\n if count > 2:\n result.append('-')\n elif count == 1:\n result.append('_')\n elif count == 2:\n result.append('__')\n count = 0\n if count > 2:\n result.append('-')\n elif count == 1:\n result.append('_')\n elif count == 2:\n result.append('__')\n return ''.join(result)", "passes": false, "model": "qwen3.8-27b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
202
|
+
{"id": "code-verifier/201", "task_id": "HumanEval/38", "entry_point": "decode_cyclic", "prompt": "\n\ndef encode_cyclic(s: str):\n \"\"\"\n returns encoded string by cycling groups of three characters.\n \"\"\"\n # split string to groups. Each of length 3.\n groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)]\n # cycle elements in each group. Unless group has fewer elements than 3.\n groups = [(group[1:] + group[0]) if len(group) == 3 else group for group in groups]\n return \"\".join(groups)\n\n\ndef decode_cyclic(s: str):\n \"\"\"\n takes as input string encoded with encode_cyclic function. Returns decoded string.\n \"\"\"\n", "solution": "def decode_cyclic(s: str):\n \"\"\"\n takes as input string encoded with encode_cyclic function. Returns decoded string.\n \"\"\"\n # reverse the cyclic shift: if group length is 3, rotate right by 1 (i.e., shift left by 1)\n # equivalently, to undo (group[1:] + group[0]), we do: group[-1] + group[0:-1]\n groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)]\n groups = [(group[-1] + group[0:-1]) if len(group) == 3 else group for group in groups]\n return \"\".join(groups)", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
203
|
+
{"id": "code-verifier/202", "task_id": "HumanEval/156", "entry_point": "int_to_mini_roman", "prompt": "\ndef int_to_mini_roman(number):\n \"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19) == 'xix'\n >>> int_to_mini_roman(152) == 'clii'\n >>> int_to_mini_roman(426) == 'cdxxvi'\n \"\"\"\n", "solution": "\ndef int_to_mini_roman(number):\n \"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19) == 'xix'\n >>> int_to_mini_roman(152) == 'clii'\n >>> int_to_mini_roman(426) == 'cdxxvi'\n \"\"\"\n if number <= 0 or number > 1000:\n raise ValueError(\"Input must be between 1 and 1000\")\n\n mapping = {\n 1000: 'm',\n 900: 'cm',\n 500: 'd',\n 400: 'cd',\n 100: 'c',\n 90: 'x',\n 50: 'l',\n 40: 'xx',\n 10: 'x',\n 9: 'ix',\n 5: 'v',\n 4: 'iv',\n 1: 'i'\n }\n\n roman_numeral = \"\"\n temp_number = number\n\n # Process in descending order of place value (thousands, hundreds, tens, ones)\n # This approach is simpler than a direct lookup table for all numbers up to 1000\n # We will use a standard greedy approach based on the largest possible symbol.\n\n symbols = [\n (1000, 'm'), (900, 'cm'), (500, 'd'), (400, 'cd'),\n (100, 'c'), (90, 'x'), (50, 'l'), (40, 'xx'),\n (10, 'x'), (9, 'ix'), (5, 'v'), (4, 'iv'), (1, 'i')\n ]\n\n result = \"\"\n remaining = number\n\n for value, symbol in symbols:\n count = remaining // value\n if count > 0:\n result += symbol * count\n remaining %= value\n\n return result", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
204
|
+
{"id": "code-verifier/203", "task_id": "HumanEval/0", "entry_point": "has_close_elements", "prompt": "from typing import List\n\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n given threshold.\n >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n False\n >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n True\n \"\"\"\n", "solution": "from typing import List\n\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n numbers_sorted = sorted(numbers)\n for i in range(len(numbers_sorted) - 1):\n if numbers_sorted[i + 1] - numbers_sorted[i] < threshold:\n return True\n return False", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
205
|
+
{"id": "code-verifier/204", "task_id": "HumanEval/63", "entry_point": "fibfib", "prompt": "\n\ndef fibfib(n: int):\n \"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1)\n 0\n >>> fibfib(5)\n 4\n >>> fibfib(8)\n 24\n \"\"\"\n", "solution": "def fibfib(n: int):\n if n == 0 or n == 1:\n return 0\n if n == 2:\n return 1\n def mat_mul(A, B):\n return [[sum(A[0][k] * B[k][j] for k in range(3)) for j in range(3)] for A,B in zip(A, B)]\n def mat_pow(M, power):\n result = [[1,0,0],[0,1,0],[0,0,1]]\n while power:\n if power & 1:\n result = mat_mul(result, M)\n M = mat_mul(M, M)\n power >>= 1\n return result\n M = [[1,1,1],[1,0,0],[0,1,0]]\n P = mat_pow(M, n-2)\n return P[0][0]", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
206
|
+
{"id": "code-verifier/205", "task_id": "HumanEval/64", "entry_point": "vowels_count", "prompt": "\nFIX = \"\"\"\nAdd more test cases.\n\"\"\"\n\ndef vowels_count(s):\n \"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2\n >>> vowels_count(\"ACEDY\")\n 3\n \"\"\"\n", "solution": "\nFIX = \"\"\"\nAdd more test cases.\n\"\"\"\n\ndef vowels_count(s):\n \"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2\n >>> vowels_count(\"ACEDY\")\n 3\n \"\"\"\n vowels = \"aeiouAEIOU\"\n count = 0\n for i, char in enumerate(s):\n if char in vowels:\n count += 1\n elif char.lower() == 'y' and i == len(s) - 1:\n count += 1\n return count", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
207
|
+
{"id": "code-verifier/206", "task_id": "HumanEval/124", "entry_point": "valid_date", "prompt": "\ndef valid_date(date):\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n for example: \n valid_date('03-11-2000') => True\n\n valid_date('15-01-2012') => False\n\n valid_date('04-0-2040') => False\n\n valid_date('06-04-2020') => True\n\n valid_date('06/04/2020') => False\n \"\"\"\n", "solution": "def valid_date(date):\n if not date:\n return False\n parts = date.split('-')\n if len(parts) != 3:\n return False\n month_str, day_str, year_str = parts\n if len(month_str) != 2 or len(day_str) != 2 or len(year_str) != 4:\n return False\n try:\n month = int(month_str)\n day = int(day_str)\n year = int(year_str)\n except ValueError:\n return False\n if month < 1 or month > 12:\n return False\n max_days = [31, 30, 31, 30, 31, 30, 31, 31, 30, 31, 30, 32]\n if month in (1,3,5,7,8,10,12):\n if day < 1 or day > max_days[month-1]:\n return False\n elif month in (4,6,9,11):\n if day < 1 or day > max_days[month-1]:\n return False\n else:\n leap = year % 400 == 0 or (year % 100 != 0 and year % 4 == 0)\n max_day = 29 if leap else 28\n if day < 1 or day > max_day:\n return False\n return True", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
208
|
+
{"id": "code-verifier/207", "task_id": "HumanEval/19", "entry_point": "sort_numbers", "prompt": "from typing import List\n\n\ndef sort_numbers(numbers: str) -> str:\n \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers('three one five')\n 'one three five'\n \"\"\"\n", "solution": "from typing import List\n\n\ndef sort_numbers(numbers: str) -> str:\n \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers('three one five')\n 'one three five'\n \"\"\"\n word_to_num = {'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9}\n sorted_words = sorted(numbers.split(), key=lambda x: word_to_num[x])\n return ' '.join(sorted_words)", "passes": true, "model": "qwen3.8-35b-a3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
209
|
+
{"id": "code-verifier/208", "task_id": "HumanEval/26", "entry_point": "remove_duplicates", "prompt": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n", "solution": "from typing import List\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n seen = set()\n result = []\n for num in numbers:\n if num not in seen:\n seen.add(num)\n result.append(num)\n return result", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
210
|
+
{"id": "code-verifier/209", "task_id": "HumanEval/1", "entry_point": "separate_paren_groups", "prompt": "from typing import List\n\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n", "solution": "from typing import List\n\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n result = []\n current_group = \"\"\n balance = 0\n for char in paren_string:\n if char == ' ':\n continue\n if char == '(':\n current_group += char\n balance += 1\n elif char == ')':\n current_group += char\n balance -= 1\n if balance == 0 and current_group:\n result.append(current_group)\n current_group = \"\"\n return result", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
211
|
+
{"id": "code-verifier/210", "task_id": "HumanEval/10", "entry_point": "make_palindrome", "prompt": "\n\ndef is_palindrome(string: str) -> bool:\n \"\"\" Test if given string is a palindrome \"\"\"\n return string == string[::-1]\n\n\ndef make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n", "solution": "def make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n if not string:\n return \"\"\n for i in range(len(string)):\n if is_palindrome(string[i:]):\n return string + string[:i][::-1]\n return string", "passes": false, "model": "qwen3.8-27b-mtp-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
212
|
+
{"id": "code-verifier/211", "task_id": "HumanEval/127", "entry_point": "intersection", "prompt": "\ndef intersection(interval1, interval2):\n \"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n intersection((1, 2), (2, 3)) ==> \"NO\"\n intersection((-1, 1), (0, 4)) ==> \"NO\"\n intersection((-3, -1), (-5, 5)) ==> \"YES\"\n \"\"\"\n", "solution": "def intersection(interval1, interval2):\n start1, end1 = interval1\n start2, end2 = interval2\n\n # Find intersection interval\n inter_start = max(start1, start2)\n inter_end = min(end1, end2)\n\n # Check if intervals intersect\n if inter_start > inter_end:\n return \"NO\"\n\n # Length of intersection (closed interval length = end - start)\n length = inter_end - inter_start\n\n # Helper to check if a number is prime\n def is_prime(n):\n if n <= 1:\n return False\n if n <= 3:\n return True\n if n % 2 == 0 or n % 3 == 0:\n return False\n i = 5\n while i * i <= n:\n if n % i == 0 or n % (i + 2) == 0:\n return False\n i += 6\n return True\n\n # Return \"YES\" if length is prime, else \"NO\"\n return \"YES\" if is_prime(length) else \"NO\"", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
213
|
+
{"id": "code-verifier/212", "task_id": "HumanEval/125", "entry_point": "split_words", "prompt": "\ndef split_words(txt):\n '''\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n split_words(\"Hello world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"Hello,world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"abcdef\") == 3 \n '''\n", "solution": "def split_words(txt):\n if ',' in txt:\n return [word for word in txt.split(',')]\n elif ' ' in txt:\n return txt.split()\n else:\n total = sum((ord(c) - ord('a')) % 2 for c in txt if c.islower())\n return total", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
214
|
+
{"id": "code-verifier/213", "task_id": "HumanEval/130", "entry_point": "tri", "prompt": "\ndef tri(n):\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\n", "solution": "def tri(n):\n if n == 0:\n return [1]\n result = [1, 3]\n for i in range(2, n + 1):\n if i % 2 == 0:\n result.append(1 + i // 2)\n else:\n result.append(result[-1] + result[-2] + 1 + (i + 1) // 2)\n return result", "passes": true, "model": "qwen3.8-27b-mtp-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
215
|
+
{"id": "code-verifier/214", "task_id": "HumanEval/47", "entry_point": "median", "prompt": "\n\ndef median(l: list):\n \"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\n", "solution": "def median(l: list):\n \"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\n l = sorted(l)\n n = len(l)\n if n % 2 == 1:\n return l[n // 2]\n else:\n return (l[n // 2] + l[n // 2 + 1]) / 2", "passes": false, "model": "spark-x2.5-4b-bench", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
216
|
+
{"id": "code-verifier/215", "task_id": "HumanEval/9", "entry_point": "rolling_max", "prompt": "from typing import List, Tuple\n\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\n", "solution": "from typing import List, Tuple\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n result = []\n current_max = None\n for num in numbers:\n if current_max is None or num > current_max:\n current_max = num\n result.append(current_max)\n return result", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
217
|
+
{"id": "code-verifier/216", "task_id": "HumanEval/10", "entry_point": "make_palindrome", "prompt": "\n\ndef is_palindrome(string: str) -> bool:\n \"\"\" Test if given string is a palindrome \"\"\"\n return string == string[::-1]\n\n\ndef make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n", "solution": "def make_palindrome(string: str) -> str:\n n = len(string)\n if n == 0:\n return ''\n best_len = 0\n for i in range(n):\n suffix = string[i:]\n if suffix == suffix[::-1]:\n if len(suffix) > best_len:\n best_len = len(suffix)\n prefix = string[:i]\n return string + prefix[::-1]", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
218
|
+
{"id": "code-verifier/217", "task_id": "HumanEval/37", "entry_point": "sort_even", "prompt": "\n\ndef sort_even(l: list):\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1, 2, 3])\n [1, 2, 3]\n >>> sort_even([5, 6, 3, 4])\n [3, 6, 5, 4]\n \"\"\"\n", "solution": "def sort_even(l: list):\n evens = [l[i] for i in range(0, len(l), 2)]\n evens.sort()\n result = []\n for i in range(len(l)):\n if i % 2 == 1:\n result.append(l[i])\n else:\n result.append(evens[i // 2])\n return result", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
219
|
+
{"id": "code-verifier/218", "task_id": "HumanEval/49", "entry_point": "modp", "prompt": "\n\ndef modp(n: int, p: int):\n \"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\n", "solution": "def modp(n: int, p: int):\n result = 1\n base = 2 % p\n while n:\n if n & 1:\n result = (result * base) % p\n base = (base * base) % p\n n >>= 1\n return result", "passes": false, "model": "lfm2.5-8b-a1b-dspark", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
220
|
+
{"id": "code-verifier/219", "task_id": "HumanEval/147", "entry_point": "get_max_triples", "prompt": "\ndef get_max_triples(n):\n \"\"\"\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 ≤ i ≤ n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n Input: n = 5\n Output: 1\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \"\"\"\n", "solution": "def get_max_triples(n):\n a = [i*i - i + 1 for i in range(1, n+1)]\n count = 0\n for i in range(n):\n for j in range(i+1, n):\n for k in range(j+1, n):\n if (a[i] + a[j] + a[k]) % 3 == 0:\n count += 1\n return count", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
221
|
+
{"id": "code-verifier/220", "task_id": "HumanEval/154", "entry_point": "cycpattern_check", "prompt": "\ndef cycpattern_check(a , b):\n \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n cycpattern_check(\"abcd\",\"abd\") => False\n cycpattern_check(\"hello\",\"ell\") => True\n cycpattern_check(\"whassup\",\"psus\") => False\n cycpattern_check(\"abab\",\"baa\") => True\n cycpattern_check(\"efef\",\"eeff\") => False\n cycpattern_check(\"himenss\",\"simen\") => True\n\n \"\"\"\n", "solution": "def cycpattern_check(a, b):\n for i in range(len(b)):\n rotation = b[i:] + b[:i]\n if rotation in a:\n return True\n return False", "passes": false, "model": "qwen3.8-27b-mtp-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
222
|
+
{"id": "code-verifier/221", "task_id": "HumanEval/150", "entry_point": "x_or_y", "prompt": "\ndef x_or_y(n, x, y):\n \"\"\"A simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n for x_or_y(7, 34, 12) == 34\n for x_or_y(15, 8, 5) == 5\n \n \"\"\"\n", "solution": "def x_or_y(n, x, y):\n if n < 2:\n return y\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return y\n return x", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
223
|
+
{"id": "code-verifier/222", "task_id": "HumanEval/39", "entry_point": "prime_fib", "prompt": "\n\ndef prime_fib(n: int):\n \"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\n", "solution": "def prime_fib(n: int):\n fib_primes = []\n a, b = 0, 1\n count = 0\n while count < n:\n if b > 1:\n is_prime = True\n i = 2\n while i * i <= b:\n if b % i == 0:\n is_prime = False\n break\n i += 1\n if is_prime:\n fib_primes.append(b)\n count += 1\n a, b = b, a + b\n return fib_primes[n - 1]", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
224
|
+
{"id": "code-verifier/223", "task_id": "HumanEval/10", "entry_point": "make_palindrome", "prompt": "\n\ndef is_palindrome(string: str) -> bool:\n \"\"\" Test if given string is a palindrome \"\"\"\n return string == string[::-1]\n\n\ndef make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n", "solution": "\n\ndef is_palindrome(string: str) -> bool:\n \"\"\" Test if given string is a palindrome \"\"\"\n return string == string[::-1]\n\n\ndef make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n n = len(string)\n if n == 0:\n return \"\"\n\n for i in range(n, 0, -1):\n suffix = string[n - i:]\n if suffix == suffix[::-1]:\n prefix_to_reverse = string[:n - i]\n return string + prefix_to_reverse[::-1]\n\n # This case should theoretically not be reached if n > 0, \n # as a single character suffix is always a palindrome.\n return string + string[::-1]", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
225
|
+
{"id": "code-verifier/224", "task_id": "HumanEval/46", "entry_point": "fib4", "prompt": "\n\ndef fib4(n: int):\n \"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5)\n 4\n >>> fib4(6)\n 8\n >>> fib4(7)\n 14\n \"\"\"\n", "solution": "def fib4(n: int):\n if n <= 1:\n return 0\n a, b, c, d = 0, 0, 2, 0\n for i in range(3, n + 1):\n next_val = a + b + c + d\n a, b, c, d = b, c, d, next_val\n return d", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
226
|
+
{"id": "code-verifier/225", "task_id": "HumanEval/156", "entry_point": "int_to_mini_roman", "prompt": "\ndef int_to_mini_roman(number):\n \"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19) == 'xix'\n >>> int_to_mini_roman(152) == 'clii'\n >>> int_to_mini_roman(426) == 'cdxxvi'\n \"\"\"\n", "solution": "def int_to_mini_roman(number):\n val = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]\n syms = [\"m\", \"cm\", \"d\", \"cd\", \"c\", \"xc\", \"l\", \"xl\", \"x\", \"ix\", \"v\", \"iv\", \"i\"]\n result = []\n for i in range(len(val)):\n while number >= val[i]:\n result.append(syms[i])\n number -= val[i]\n return ''.join(result).lower()", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
227
|
+
{"id": "code-verifier/226", "task_id": "HumanEval/65", "entry_point": "circular_shift", "prompt": "\ndef circular_shift(x, shift):\n \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n \"21\"\n >>> circular_shift(12, 2)\n \"12\"\n \"\"\"\n", "solution": "def circular_shift(x, shift):\n s = str(abs(x))\n n = len(s)\n if n == 0:\n return \"\"\n total_shift = shift % n\n if total_shift == 0:\n return s[::-1]\n shifted = s[-total_shift:] + s[:-total_shift]\n reversed_str = shifted[::-1]\n if int(reversed_str) > 10**n - 1:\n return str(int(reversed_str)) % (10**n)\n else:\n return reversed_str", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
228
|
+
{"id": "code-verifier/227", "task_id": "HumanEval/115", "entry_point": "max_fill", "prompt": "import math\n\ndef max_fill(grid, capacity):\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n Input: \n grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n bucket_capacity : 1\n Output: 6\n\n Example 2:\n Input: \n grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n bucket_capacity : 2\n Output: 5\n \n Example 3:\n Input: \n grid : [[0,0,0], [0,0,0]]\n bucket_capacity : 5\n Output: 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n", "solution": "import math\n\ndef max_fill(grid, capacity):\n total = 0\n for row in grid:\n cnt = sum(row)\n total += (cnt + capacity - 1) // capacity\n return total", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
229
|
+
{"id": "code-verifier/228", "task_id": "HumanEval/9", "entry_point": "rolling_max", "prompt": "from typing import List, Tuple\n\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\n", "solution": "from typing import List, Tuple\n\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\n result = []\n current_max = float('-inf')\n for num in numbers:\n if num > current_max:\n current_max = num\n result.append(current_max)", "passes": false, "model": "lfm2.5-8b-a1b-dspark", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
230
|
+
{"id": "code-verifier/229", "task_id": "HumanEval/11", "entry_point": "string_xor", "prompt": "from typing import List\n\n\ndef string_xor(a: str, b: str) -> str:\n \"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor('010', '110')\n '100'\n \"\"\"\n", "solution": "from typing import List\n\ndef string_xor(a: str, b: str) -> str:\n return ''.join('1' if x != y else '0' for x, y in zip(a, b))", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
231
|
+
{"id": "code-verifier/230", "task_id": "HumanEval/107", "entry_point": "even_odd_palindrome", "prompt": "\ndef even_odd_palindrome(n):\n \"\"\"\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n Input: 3\n Output: (1, 2)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n Input: 12\n Output: (4, 6)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \"\"\"\n", "solution": "\ndef even_odd_palindrome(n):\n \"\"\"\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n Input: 3\n Output: (1, 2)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n Input: 12\n Output: (4, 6)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \"\"\"\n even_count = 0\n odd_count = 0\n\n for i in range(1, n):\n s = str(i)\n if s == s[::-1]:\n if i % 2 == 0:\n even_count += 1\n else:\n odd_count += 1\n\n return (even_count, odd_count)", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
232
|
+
{"id": "code-verifier/231", "task_id": "HumanEval/102", "entry_point": "choose_num", "prompt": "\ndef choose_num(x, y):\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n", "solution": "\ndef choose_num(x, y):\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n if x > y:\n return -1\n candidate = y if y % 2 == 0 else y - 1\n if candidate >= x:\n return candidate\n return -1", "passes": true, "model": "bonsai2-27b-pq2-np4", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
233
|
+
{"id": "code-verifier/232", "task_id": "HumanEval/50", "entry_point": "decode_shift", "prompt": "\n\ndef encode_shift(s: str):\n \"\"\"\n returns encoded string by shifting every character by 5 in the alphabet.\n \"\"\"\n return \"\".join([chr(((ord(ch) + 5 - ord(\"a\")) % 26) + ord(\"a\")) for ch in s])\n\n\ndef decode_shift(s: str):\n \"\"\"\n takes as input string encoded with encode_shift function. Returns decoded string.\n \"\"\"\n", "solution": "\n\ndef encode_shift(s: str):\n \"\"\"\n returns encoded string by shifting every character by 5 in the alphabet.\n \"\"\"\n return \"\".join([chr(((ord(ch) + 5 - ord(\"a\")) % 26) + ord(\"a\")) for ch in s])\n\n\ndef decode_shift(s: str):\n \"\"\"\n takes as input string encoded with encode_shift function. Returns decoded string.\n \"\"\"\n return \"\".join([chr(((ord(ch) - 5 + 26) % 26) + ord(\"a\")) for ch in s])", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
234
|
+
{"id": "code-verifier/233", "task_id": "HumanEval/113", "entry_point": "odd_count", "prompt": "\ndef odd_count(lst):\n \"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count(['1234567'])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count(['3',\"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \"\"\"\n", "solution": "\ndef odd_count(lst):\n \"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count(['1234567'])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count(['3',\"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \"\"\"\n result = []\n for i, s in enumerate(lst):\n odd_digits = 0\n for char in s:\n digit = int(char)\n if digit % 2 != 0:\n odd_digits += 1\n\n # The docstring examples seem to have a very specific, non-standard formatting\n # that replaces 'i' with the count, and also seems to replace other characters\n # with the count in the provided examples.\n # Let's strictly follow the description: \"Each element i of the output should be \n # 'the number of odd elements in the string i of the input.' where all the i's \n # should be replaced by the number of odd digits in the i'th string of the input.\"\n\n # Standard interpretation of the description:\n # template = \"the number of odd elements in the string {i} of the input.\"\n # output_string = template.format(i=odd_digits)\n # result.append(output_string)\n\n # However, the doctests show a highly corrupted string format:\n # >>> odd_count(['1234567'])\n # [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n # Here, 4 is the count. It replaces '4' in '4n' and '4' in 'str4ng' and '4' in '4'.\n\n # Given the ambiguity, I will implement the literal description first, \n # as the doctests appear to be flawed or based on an unstated complex substitution rule.\n # If the goal is to pass the doctests exactly, the logic is:\n # 1. Count odd digits (count).\n # 2. Replace every 'i' in the template with 'count'.\n # 3. Replace every 'n' in the template with 'count' (based on the first example).\n # 4. Replace every 's' in the template with 'count' (based on the first example).\n\n # Let's assume the description meant:\n # \"the number of odd elements in the string [count] of the input.\"\n\n # Re-examining the doctest:\n # Input: ['1234567'] -> Count = 4\n # Output: \"the number of odd elements 4n the str4ng 4 of the 4nput.\"\n\n # This suggests a template: \"the number of odd elements {C}n the str{C}ng {C} of the {C}nput.\"\n\n template = \"the number of odd elements {C}n the str{C}ng {C} of the {C}nput.\"\n result.append(template.format(C=str(odd_digits)))\n\n return result", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
235
|
+
{"id": "code-verifier/234", "task_id": "HumanEval/115", "entry_point": "max_fill", "prompt": "import math\n\ndef max_fill(grid, capacity):\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n Input: \n grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n bucket_capacity : 1\n Output: 6\n\n Example 2:\n Input: \n grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n bucket_capacity : 2\n Output: 5\n \n Example 3:\n Input: \n grid : [[0,0,0], [0,0,0]]\n bucket_capacity : 5\n Output: 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n", "solution": "import math\n\ndef max_fill(grid, bucket_capacity):\n total_water = sum(sum(row) for row in grid)\n return (total_water + bucket_capacity - 1) // bucket_capacity if total_water > 0 else 0", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
236
|
+
{"id": "code-verifier/235", "task_id": "HumanEval/99", "entry_point": "closest_integer", "prompt": "\ndef closest_integer(value):\n '''\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n '''\n", "solution": "def closest_integer(value):\n num = float(value)\n if num > 0:\n return int(num + 0.5)\n else:\n return int(num - 0.5)", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
237
|
+
{"id": "code-verifier/236", "task_id": "HumanEval/133", "entry_point": "sum_squares", "prompt": "\n\ndef sum_squares(lst):\n \"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n For lst = [1,2,3] the output should be 14\n For lst = [1,4,9] the output should be 98\n For lst = [1,3,5,7] the output should be 84\n For lst = [1.4,4.2,0] the output should be 29\n For lst = [-2.4,1,1] the output should be 6\n \n\n \"\"\"\n", "solution": "def sum_squares(lst):\n total = 0\n for x in lst:\n ceil_x = math.ceil(x)\n total += ceil_x * ceil_x\n return total", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
238
|
+
{"id": "code-verifier/237", "task_id": "HumanEval/104", "entry_point": "unique_digits", "prompt": "\ndef unique_digits(x):\n \"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n >>> unique_digits([152, 323, 1422, 10])\n []\n \"\"\"\n", "solution": "\ndef unique_digits(x):\n \"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n >>> unique_digits([152, 323, 1422, 10])\n []\n \"\"\"\n return sorted([num for num in x if all(int(digit) % 2 != 0 for digit in str(num))])", "passes": true, "model": "gemma4-12b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
239
|
+
{"id": "code-verifier/238", "task_id": "HumanEval/1", "entry_point": "separate_paren_groups", "prompt": "from typing import List\n\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n", "solution": "from typing import List\n\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n result = []\n current = []\n depth = 0\n for ch in paren_string:\n if ch == ' ':\n continue\n if ch == '(':\n depth += 1\n if depth == 1:\n current = []\n elif ch == ')':\n if depth == 1:\n result.append(''.join(current))\n current = []\n depth -= 1\n else:\n current.append(ch)\n return result", "passes": false, "model": "qwen3.8-35b-a3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
240
|
+
{"id": "code-verifier/239", "task_id": "HumanEval/55", "entry_point": "fib", "prompt": "\n\ndef fib(n: int):\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n", "solution": "def fib(n: int):\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n if n <= 0:\n return 0\n if n == 1 or n == 2:\n return 1\n a, b = 0, 1\n for _ in range(2, n + 1):\n a, b = b, a + b\n return b", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
241
|
+
{"id": "code-verifier/240", "task_id": "HumanEval/103", "entry_point": "rounded_avg", "prompt": "\ndef rounded_avg(n, m):\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\n", "solution": "def rounded_avg(n,m):\n \"\"\"You are given two positive integers n and m...\"\"\"\n if n > m:\n return -1\n avg = (n + m) / 2.0\n # rounding to nearest integer, .5 rounds down\n int_part = int(avg)\n frac = avg - int_part\n if frac < 0.5:\n rounded = int_part\n elif frac > 0.5:\n rounded = int_part + 1\n else: # exactly half case -> round down to floor\n rounded = int_part\n return bin(rounded)", "passes": false, "model": "minicpm5-2b-q4-bench-rp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
242
|
+
{"id": "code-verifier/241", "task_id": "HumanEval/46", "entry_point": "fib4", "prompt": "\n\ndef fib4(n: int):\n \"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5)\n 4\n >>> fib4(6)\n 8\n >>> fib4(7)\n 14\n \"\"\"\n", "solution": "def fib4(n: int):\n if n == 0 or n == 1:\n return 0\n if n == 2:\n return 2\n if n == 3:\n return 0\n a, b, c, d = 0, 0, 2, 0\n for _ in range(4, n + 1):\n next_val = a + b + c + d\n a, b, c, d = b, c, d, next_val\n return d", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
243
|
+
{"id": "code-verifier/242", "task_id": "HumanEval/72", "entry_point": "will_it_fly", "prompt": "\ndef will_it_fly(q,w):\n '''\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n will_it_fly([1, 2], 5) ➞ False \n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n will_it_fly([3, 2, 3], 1) ➞ False\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n will_it_fly([3, 2, 3], 9) ➞ True\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n will_it_fly([3], 5) ➞ True\n # 3 is less than the maximum possible weight, and it's balanced.\n '''\n", "solution": "def will_it_fly(q,w):\n return len(q)==len(q[::-1]) and sum(q) <= w", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
244
|
+
{"id": "code-verifier/243", "task_id": "HumanEval/89", "entry_point": "encrypt", "prompt": "\ndef encrypt(s):\n \"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n encrypt('hi') returns 'lm'\n encrypt('asdfghjkl') returns 'ewhjklnop'\n encrypt('gf') returns 'kj'\n encrypt('et') returns 'ix'\n \"\"\"\n", "solution": "\ndef encrypt(s):\n \"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n encrypt('hi') returns 'lm'\n encrypt('asdfghjkl') returns 'ewhjklnop'\n encrypt('gf') returns 'kj'\n encrypt('et') returns 'ix'\n \"\"\"\n result = []\n for char in s:\n if 'a' <= char <= 'z':\n result.append(chr((ord(char) - ord('a') + 4) % 26 + ord('a')))\n elif 'A' <= char <= 'Z':\n result.append(chr((ord(char) - ord('A') + 4) % 26 + ord('A')))\n else:\n result.append(char)\n return ''.join(result)", "passes": true, "model": "qwen3.6-35b-a3b-bench", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
245
|
+
{"id": "code-verifier/244", "task_id": "HumanEval/91", "entry_point": "is_bored", "prompt": "\ndef is_bored(S):\n \"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored(\"Hello world\")\n 0\n >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n 1\n \"\"\"\n", "solution": "def is_bored(S):\n count = 0\n for s in S.replace('.', '\\n').replace('?', '\\n').replace('!', '\\n').split('\\n'):\n s = s.strip()\n if s:\n words = s.split()\n if words[0] == 'I':\n count += 1\n return count", "passes": false, "model": "bonsai2-27b-pq2-np4", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
246
|
+
{"id": "code-verifier/245", "task_id": "HumanEval/22", "entry_point": "filter_integers", "prompt": "from typing import List, Any\n\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', {}, []])\n [1, 2, 3]\n \"\"\"\n", "solution": "from typing import List, Any\n\ndef filter_integers(values: List[Any]) -> List[int]:\n return [x for x in values if isinstance(x, int) and not isinstance(x, bool)]", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
247
|
+
{"id": "code-verifier/246", "task_id": "HumanEval/101", "entry_point": "words_string", "prompt": "\ndef words_string(s):\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n", "solution": "def words_string(s):\n import re\n return re.split(r'[, ]+', s.strip())", "passes": false, "model": "qwen3.8-27b-mtp-nothink", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
248
|
+
{"id": "code-verifier/247", "task_id": "HumanEval/124", "entry_point": "valid_date", "prompt": "\ndef valid_date(date):\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n for example: \n valid_date('03-11-2000') => True\n\n valid_date('15-01-2012') => False\n\n valid_date('04-0-2040') => False\n\n valid_date('06-04-2020') => True\n\n valid_date('06/04/2020') => False\n \"\"\"\n", "solution": "def valid_date(date):\n if not date or len(date) != 10:\n return False\n parts = date.split('-')\n if len(parts) != 3:\n return False\n month_str, day_str, year_str = parts\n if not month_str.isdigit() or not day_str.isdigit() or not year_str.isdigit():\n return False\n month = int(month_str)\n day = int(day_str)\n year = int(year_str)\n if month < 1 or month > 12:\n return False\n if month in [4, 6, 9, 11] and (day < 1 or day > 30):\n return False\n if month == 2 and (day < 1 or day > 29):\n return False\n if month in [1, 3, 5, 7, 8, 10, 12] and (day < 1 or day > 31):\n return False\n if len(day_str) != 2 or len(month_str) != 2 or len(year_str) != 4:\n return False\n return True", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
249
|
+
{"id": "code-verifier/248", "task_id": "HumanEval/163", "entry_point": "generate_integers", "prompt": "\ndef generate_integers(a, b):\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\n", "solution": "\ndef generate_integers(a, b):\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\n return [i for i in range(min(a, b), max(a, b) + 1) if i % 2 == 0 and i < 10]", "passes": false, "model": "qwen3.6-35b-a3b-bench", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
250
|
+
{"id": "code-verifier/249", "task_id": "HumanEval/106", "entry_point": "f", "prompt": "\ndef f(n):\n \"\"\" Implement the function f that takes n as a parameter,\n and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n f(5) == [1, 2, 6, 24, 15]\n \"\"\"\n", "solution": "def f(n):\n result = []\n for i in range(1, n + 1):\n if i % 2 == 0:\n fact = 1\n for j in range(1, i + 1):\n fact *= j\n result.append(fact)\n else:\n result.append(sum(range(1, i + 1)))\n return result", "passes": true, "model": "qwen3.8-27b-mtp-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
251
|
+
{"id": "code-verifier/250", "task_id": "HumanEval/86", "entry_point": "anti_shuffle", "prompt": "\ndef anti_shuffle(s):\n \"\"\"\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n anti_shuffle('Hi') returns 'Hi'\n anti_shuffle('hello') returns 'ehllo'\n anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\n \"\"\"\n", "solution": "def anti_shuffle(s):\n words = s.split()\n ordered_words = sorted(words, key=lambda x: ord(x))\n return ' '.join(ordered_words)", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
252
|
+
{"id": "code-verifier/251", "task_id": "HumanEval/154", "entry_point": "cycpattern_check", "prompt": "\ndef cycpattern_check(a , b):\n \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n cycpattern_check(\"abcd\",\"abd\") => False\n cycpattern_check(\"hello\",\"ell\") => True\n cycpattern_check(\"whassup\",\"psus\") => False\n cycpattern_check(\"abab\",\"baa\") => True\n cycpattern_check(\"efef\",\"eeff\") => False\n cycpattern_check(\"himenss\",\"simen\") => True\n\n \"\"\"\n", "solution": "def cycpattern_check(a , b):\n if not b:\n return True\n if not a:\n return False\n\n b_str = b + b\n for i in range(len(b)):\n rotated_b = b_str[i : i + len(b)]\n if rotated_b in a:\n return True\n return False", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
253
|
+
{"id": "code-verifier/252", "task_id": "HumanEval/145", "entry_point": "order_by_points", "prompt": "\ndef order_by_points(nums):\n \"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n >>> order_by_points([]) == []\n \"\"\"\n", "solution": "def order_by_points(nums):\n def digit_sum(num):\n s = str(abs(num))\n total = 0\n for ch in s:\n total += int(ch)\n return total\n\n indexed = list(enumerate(nums))\n sorted_indexed = sorted(indexed, key=lambda x: (digit_sum(x[1]), x[0]))\n return [value for idx, value in sorted_indexed]", "passes": false, "model": "minicpm5-2b-q8-bench-rp105", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
254
|
+
{"id": "code-verifier/253", "task_id": "HumanEval/130", "entry_point": "tri", "prompt": "\ndef tri(n):\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\n", "solution": "\ndef tri(n):\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\n max_index = n + 1\n seq = [0] * (max_index + 1)\n for i in range(0, max_index + 1):\n if i % 2 == 0:\n seq[i] = 1 + i // 2\n if n >= 1:\n seq[1] = 3\n for i in range(3, n + 1, 2):\n seq[i] = seq[i - 1] + seq[i - 2] + seq[i + 1]\n return seq[:n + 1]", "passes": true, "model": "minicpm5-2b-q8-bench-rp105", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
255
|
+
{"id": "code-verifier/254", "task_id": "HumanEval/134", "entry_point": "check_if_last_char_is_a_letter", "prompt": "\ndef check_if_last_char_is_a_letter(txt):\n '''\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") ➞ False\n check_if_last_char_is_a_letter(\"apple pi e\") ➞ True\n check_if_last_char_is_a_letter(\"apple pi e \") ➞ False\n check_if_last_char_is_a_letter(\"\") ➞ False \n '''\n", "solution": "\ndef check_if_last_char_is_a_letter(txt):\n '''\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") ➞ False\n check_if_last_char_is_a_letter(\"apple pi e\") ➞ True\n check_if_last_char_is_a_letter(\"apple pi e \") ➞ False\n check_if_last_char_is_a_letter(\"\") ➞ False \n '''\n txt = txt.rstrip()\n if not txt:\n return False\n\n last_char = txt[-1]\n\n if not last_char.isalpha():\n return False\n\n # Check if the last character is a part of a word.\n # A character is part of a word if it is preceded by another non-space character.\n # Since we stripped trailing spaces, we only need to check the character before the last one.\n if len(txt) > 1:\n second_to_last_char = txt[-2]\n if not second_to_last_char.isspace():\n return False\n\n return True", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
256
|
+
{"id": "code-verifier/255", "task_id": "HumanEval/115", "entry_point": "max_fill", "prompt": "import math\n\ndef max_fill(grid, capacity):\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n Input: \n grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n bucket_capacity : 1\n Output: 6\n\n Example 2:\n Input: \n grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n bucket_capacity : 2\n Output: 5\n \n Example 3:\n Input: \n grid : [[0,0,0], [0,0,0]]\n bucket_capacity : 5\n Output: 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n", "solution": "import math\n\ndef max_fill(grid, capacity):\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n Input: \n grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n bucket_capacity : 1\n Output: 6\n\n Example 2:\n Input: \n grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n bucket_capacity : 2\n Output: 5\n \n Example 3:\n Input: \n grid : [[0,0,0], [0,0,0]]\n bucket_capacity : 5\n Output: 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n total = 0\n for row in grid:\n water = sum(row)\n total += math.ceil(water / capacity)\n return total", "passes": true, "model": "ornith-35b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
257
|
+
{"id": "code-verifier/256", "task_id": "HumanEval/156", "entry_point": "int_to_mini_roman", "prompt": "\ndef int_to_mini_roman(number):\n \"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19) == 'xix'\n >>> int_to_mini_roman(152) == 'clii'\n >>> int_to_mini_roman(426) == 'cdxxvi'\n \"\"\"\n", "solution": "def int_to_mini_roman(number):\n roman_map = {\n 1: 'i', 2: 'ii', 3: 'iii', 4: 'iv', 5: 'v', 6: 'vi', 7: 'vii', 8: 'viii', 9: 'ix',\n 10: 'x', 20: 'xx', 30: 'xxx', 40: 'xl', 50: 'l', 60: 'lx', 70: 'lxx', 80: 'lxxx', 90: 'lix',\n 100: 'c', 200: 'cxx', 300: 'cxx', 400: 'cd', 500: 'd', 600: 'dxx', 700: 'dxx', 800: 'dxxx', 900: 'dlix'\n }\n result = ''\n for value, symbol in sorted(roman_map.items(), key=lambda x: x[0], reverse=True):\n if number >= value:\n count = number // value\n result += symbol * count\n number -= value * count\n return result", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
258
|
+
{"id": "code-verifier/257", "task_id": "HumanEval/88", "entry_point": "sort_array", "prompt": "\ndef sort_array(array):\n \"\"\"\n Given an array of non-negative integers, return a copy of the given array after sorting,\n you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n or sort it in descending order if the sum( first index value, last index value) is even.\n\n Note:\n * don't change the given array.\n\n Examples:\n * sort_array([]) => []\n * sort_array([5]) => [5]\n * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\n \"\"\"\n", "solution": "def sort_array(array):\n if not array:\n return array.copy()\n first = array[0]\n last = array[-1]\n total = first + last\n if total % 2 == 1:\n return sorted(array)\n else:\n return sorted(array, reverse=True)", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
259
|
+
{"id": "code-verifier/258", "task_id": "HumanEval/153", "entry_point": "Strongest_Extension", "prompt": "\ndef Strongest_Extension(class_name, extensions):\n \"\"\"You will be given the name of a class (a string) and a list of extensions.\n The extensions are to be used to load additional classes to the class. The\n strength of the extension is as follows: Let CAP be the number of the uppercase\n letters in the extension's name, and let SM be the number of lowercase letters \n in the extension's name, the strength is given by the fraction CAP - SM. \n You should find the strongest extension and return a string in this \n format: ClassName.StrongestExtensionName.\n If there are two or more extensions with the same strength, you should\n choose the one that comes first in the list.\n For example, if you are given \"Slices\" as the class and a list of the\n extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n (its strength is -1).\n Example:\n for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\n \"\"\"\n", "solution": "def Strongest_Extension(class_name, extensions):\n max_strength = -float('inf')\n strongest = None\n for ext in extensions:\n cap = sum(1 for c in ext if c.isupper())\n sm = sum(1 for c in ext if c.islower())\n strength = cap - sm\n if strength > max_strength or (strength == max_strength and (strongest is None or ext < strongest)):\n max_strength = strength\n strongest = ext\n return f\"{class_name}.{strongest}\"", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
260
|
+
{"id": "code-verifier/259", "task_id": "HumanEval/63", "entry_point": "fibfib", "prompt": "\n\ndef fibfib(n: int):\n \"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1)\n 0\n >>> fibfib(5)\n 4\n >>> fibfib(8)\n 24\n \"\"\"\n", "solution": "def fibfib(n: int):\n if n == 0 or n == 1:\n return 0\n if n == 2:\n return 1\n a, b, c = 0, 0, 1\n for i in range(3, n + 1):\n a, b, c = b, c, a + b + c\n return c", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
261
|
+
{"id": "code-verifier/260", "task_id": "HumanEval/138", "entry_point": "is_equal_to_sum_even", "prompt": "\ndef is_equal_to_sum_even(n):\n \"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n is_equal_to_sum_even(4) == False\n is_equal_to_sum_even(6) == False\n is_equal_to_sum_even(8) == True\n \"\"\"\n", "solution": "def is_equal_to_sum_even(n):\n if n < 8:\n return False\n return n % 4 == 0", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
262
|
+
{"id": "code-verifier/261", "task_id": "HumanEval/64", "entry_point": "vowels_count", "prompt": "\nFIX = \"\"\"\nAdd more test cases.\n\"\"\"\n\ndef vowels_count(s):\n \"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2\n >>> vowels_count(\"ACEDY\")\n 3\n \"\"\"\n", "solution": "\nFIX = \"\"\"\nAdd more test cases.\n\"\"\"\n\ndef vowels_count(s):\n \"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2\n >>> vowels_count(\"ACEDY\")\n 3\n \"\"\"\n vowels = \"aeiou\"\n count = 0\n s = s.lower()\n n = len(s)\n for i in range(n):\n char = s[i]\n if char in vowels:\n count += 1\n elif char == 'y' and i == n - 1:\n count += 1\n return count", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
263
|
+
{"id": "code-verifier/262", "task_id": "HumanEval/160", "entry_point": "do_algebra", "prompt": "\ndef do_algebra(operator, operand):\n \"\"\"\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \"\"\"\n", "solution": "def do_algebra(operator, operand):\n if not operand:\n return 0\n if len(operator) != len(operand) - 1:\n raise ValueError(\"Length of operator list must be equal to the length of operand list minus one.\")\n\n result = operand[0]\n for i in range(len(operator)):\n op = operator[i]\n next_operand = operand[i + 1]\n\n if op == '+':\n result += next_operand\n elif op == '-':\n result -= next_operand\n elif op == '*':\n result *= next_operand\n elif op == '//':\n # Assuming integer division as per the problem context (non-negative integers)\n result //= next_operand\n elif op == '**':\n result **= next_operand\n else:\n raise ValueError(f\"Unsupported operator: {op}\")\n\n return result", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
264
|
+
{"id": "code-verifier/263", "task_id": "HumanEval/112", "entry_point": "reverse_delete", "prompt": "\ndef reverse_delete(s,c):\n \"\"\"Task\n We are given two strings s and c, you have to deleted all the characters in s that are equal to any character in c\n then check if the result string is palindrome.\n A string is called palindrome if it reads the same backward as forward.\n You should return a tuple containing the result string and True/False for the check.\n Example\n For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n For s = \"abcdef\", c = \"b\" the result should be ('acdef',False)\n For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\n \"\"\"\n", "solution": "def reverse_delete(s, c):\n # Create a set of characters to delete for O(1) lookups\n chars_to_remove = set(c)\n # Filter out characters in s that are in the deletion set\n filtered = [char for char in s if char not in chars_to_remove]\n result_str = ''.join(filtered)\n is_palindrome = (result_str == result_str[::-1])\n return (result_str, is_palindrome)", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
265
|
+
{"id": "code-verifier/264", "task_id": "HumanEval/154", "entry_point": "cycpattern_check", "prompt": "\ndef cycpattern_check(a , b):\n \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n cycpattern_check(\"abcd\",\"abd\") => False\n cycpattern_check(\"hello\",\"ell\") => True\n cycpattern_check(\"whassup\",\"psus\") => False\n cycpattern_check(\"abab\",\"baa\") => True\n cycpattern_check(\"efef\",\"eeff\") => False\n cycpattern_check(\"himenss\",\"simen\") => True\n\n \"\"\"\n", "solution": "def cycpattern_check(a, b):\n for i in range(len(b)):\n rot = b[i:] + b[:i]\n if rot in a:\n return True\n return False", "passes": false, "model": "ornith-35b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
266
|
+
{"id": "code-verifier/265", "task_id": "HumanEval/6", "entry_point": "parse_nested_parens", "prompt": "from typing import List\n\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n \"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n For each of the group, output the deepest level of nesting of parentheses.\n E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n >>> parse_nested_parens('(()()) ((())) () ((())()())')\n [2, 3, 1, 3]\n \"\"\"\n", "solution": "from typing import List\n\ndef parse_nested_parens(paren_string: str) -> List[int]:\n result = []\n for group in paren_string.split():\n depth = 0\n max_depth = 0\n for ch in group:\n if ch == '(':\n depth += 1\n if depth > max_depth:\n max_depth = depth\n elif ch == ')':\n depth -= 1\n result.append(max_depth)\n return result", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
267
|
+
{"id": "code-verifier/266", "task_id": "HumanEval/152", "entry_point": "compare", "prompt": "\ndef compare(game,guess):\n \"\"\"I think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\n \"\"\"\n", "solution": "\ndef compare(game,guess):\n \"\"\"I think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\n \"\"\"\n [abs(score - guess) for score, guess in zip(game, guess)]", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
268
|
+
{"id": "code-verifier/267", "task_id": "HumanEval/160", "entry_point": "do_algebra", "prompt": "\ndef do_algebra(operator, operand):\n \"\"\"\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \"\"\"\n", "solution": "def do_algebra(operator, operand):\n if not operator:\n return operand[0]\n \n # Use eval() for simplicity, as the operations are basic and the input is controlled.\n # We construct the expression string by interleaving operators and operands.\n expression = str(operand[0])\n for i in range(len(operator)):\n expression += operator[i] + str(operand[i+1])\n \n return eval(expression)", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
269
|
+
{"id": "code-verifier/268", "task_id": "HumanEval/19", "entry_point": "sort_numbers", "prompt": "from typing import List\n\n\ndef sort_numbers(numbers: str) -> str:\n \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers('three one five')\n 'one three five'\n \"\"\"\n", "solution": "from typing import List\n\n\ndef sort_numbers(numbers: str) -> str:\n \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n Return the string with numbers sorted from smallest to largest\n >>> sort_numbers('three one five')\n 'one three five'\n \"\"\"\n words = numbers.split()\n mapping = {\n 'zero': '0',\n 'one': '1',\n 'two': '2',\n 'three': '3',\n 'four': '4',\n 'five': '5',\n 'six': '6',\n 'seven': '7',\n 'eight': '8',\n 'nine': '9'\n }\n\n sorted_numbers = []\n for word in words:\n sorted_numbers.append(mapping[word])\n\n sorted_numbers.sort()\n\n result = [str(num) for num in sorted_numbers]\n return ' '.join(result)", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
270
|
+
{"id": "code-verifier/269", "task_id": "HumanEval/163", "entry_point": "generate_integers", "prompt": "\ndef generate_integers(a, b):\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\n", "solution": "\ndef generate_integers(a, b):\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\n start, end = min(a, b), max(a, b)\n return [d for d in (0, 2, 4, 6, 8) if start <= d <= end]", "passes": true, "model": "qwen3.8-27b-mtp-xhigh", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
271
|
+
{"id": "code-verifier/270", "task_id": "HumanEval/101", "entry_point": "words_string", "prompt": "\ndef words_string(s):\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n", "solution": "def words_string(s):\n import re\n return re.findall(r'\\b\\w+\\b', s)", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
272
|
+
{"id": "code-verifier/271", "task_id": "HumanEval/103", "entry_point": "rounded_avg", "prompt": "\ndef rounded_avg(n, m):\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\n", "solution": "\ndef rounded_avg(n, m):\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\n if n > m:\n return -1\n\n average = (n + m) / 2\n rounded_average = round(average)\n\n return bin(rounded_average)", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
273
|
+
{"id": "code-verifier/272", "task_id": "HumanEval/55", "entry_point": "fib", "prompt": "\n\ndef fib(n: int):\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n", "solution": "def fib(n: int):\n if n == 1 or n == 2:\n return 1\n a, b = 1, 1\n for _ in range(3, n + 1):\n a, b = b, a + b\n return b", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
274
|
+
{"id": "code-verifier/273", "task_id": "HumanEval/13", "entry_point": "greatest_common_divisor", "prompt": "\n\ndef greatest_common_divisor(a: int, b: int) -> int:\n \"\"\" Return a greatest common divisor of two integers a and b\n >>> greatest_common_divisor(3, 5)\n 1\n >>> greatest_common_divisor(25, 15)\n 5\n \"\"\"\n", "solution": "def greatest_common_divisor(a: int, b: int) -> int:\n while b:\n a, b = b, a % b\n return a", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
275
|
+
{"id": "code-verifier/274", "task_id": "HumanEval/122", "entry_point": "add_elements", "prompt": "\ndef add_elements(arr, k):\n \"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n Output: 24 # sum of 21 + 3\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\n", "solution": "\ndef add_elements(arr, k):\n \"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n Output: 24 # sum of 21 + 3\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\n total_sum = 0\n for i in range(k):\n element = arr[i]\n if 0 <= element <= 99:\n total_sum += element\n return total_sum", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
276
|
+
{"id": "code-verifier/275", "task_id": "HumanEval/39", "entry_point": "prime_fib", "prompt": "\n\ndef prime_fib(n: int):\n \"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\n", "solution": "\n\ndef prime_fib(n: int):\n \"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\n if n <= 0:\n return None\n\n small_primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37)\n bases_64 = (2, 325, 9375, 28178, 450775, 9780504, 1795265022)\n bases_large = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71)\n\n def is_prime(x):\n if x < 2:\n return False\n for p in small_primes:\n if x % p == 0:\n return x == p\n d = x - 1\n s = 0\n while d % 2 == 0:\n s += 1\n d //= 2\n if x < (1 << 64):\n bases = bases_64\n else:\n bases = bases_large\n for a in bases:\n a %= x\n if a == 0:\n continue\n y = pow(a, d, x)\n if y == 1 or y == x - 1:\n continue\n for _ in range(s - 1):\n y = (y * y) % x\n if y == x - 1:\n break\n else:\n return False\n return True\n\n def is_prime_index(k):\n if k < 2:\n return False\n if k % 2 == 0:\n return k == 2\n i = 3\n while i * i <= k:\n if k % i == 0:\n return False\n i += 2\n return True\n\n count = 0\n a, b = 2, 3\n idx = 3\n while True:\n if idx == 4 or is_prime_index(idx):\n if is_prime(a):\n count += 1\n if count == n:\n return a\n a, b = b, a + b\n idx += 1", "passes": true, "model": "qwen3.8-27b-q4-xhigh", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
277
|
+
{"id": "code-verifier/276", "task_id": "HumanEval/74", "entry_point": "total_match", "prompt": "\ndef total_match(lst1, lst2):\n '''\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n total_match([], []) ➞ []\n total_match(['hi', 'admin'], ['hI', 'Hi']) ➞ ['hI', 'Hi']\n total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) ➞ ['hi', 'admin']\n total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) ➞ ['hI', 'hi', 'hi']\n total_match(['4'], ['1', '2', '3', '4', '5']) ➞ ['4']\n '''\n", "solution": "def total_match(lst1, lst2):\n sum1 = sum(len(s) for s in lst1)\n sum2 = sum(len(s) for s in lst2)\n if sum1 < sum2:\n return lst1\n else:\n return lst2", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
278
|
+
{"id": "code-verifier/277", "task_id": "HumanEval/109", "entry_point": "move_one_ball", "prompt": "\ndef move_one_ball(arr):\n \"\"\"We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n move_one_ball([3, 4, 5, 1, 2])==>True\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n move_one_ball([3, 5, 4, 1, 2])==>False\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \"\"\"\n", "solution": "def move_one_ball(arr):\n n = len(arr)\n if n == 0:\n return True\n cnt = 0\n for i in range(n):\n if arr[i] > arr[(i+1) % n]:\n cnt += 1\n if cnt > 1:\n return False\n return cnt <= 1", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
279
|
+
{"id": "code-verifier/278", "task_id": "HumanEval/141", "entry_point": "file_name_check", "prompt": "\ndef file_name_check(file_name):\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n file_name_check(\"example.txt\") # => 'Yes'\n file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n \"\"\"\n", "solution": "def file_name_check(file_name):\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'.\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n file_name_check(\"example.txt\") # => 'Yes'\n file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n \"\"\"\n digit_count = sum(1 for ch in file_name if '0' <= ch <= '9')\n if digit_count > 3:\n return \"No\"\n \n if file_name.count('.') != 1:\n return \"No\"\n \n base, ext = file_name.split('.')\n # Base must be non-empty and start with a latin letter\n if not base or (not ('a' <= base[0] <= 'z') and not ('A' <= base[0] <= 'Z')):\n return \"No\"\n \n allowed_extensions = {'txt', 'exe', 'dll'}\n if ext not in allowed_extensions:\n return \"No\"\n \n return \"Yes\"", "passes": false, "model": "minicpm5-2b-q8-bench-rp115", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
280
|
+
{"id": "code-verifier/279", "task_id": "HumanEval/107", "entry_point": "even_odd_palindrome", "prompt": "\ndef even_odd_palindrome(n):\n \"\"\"\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n Input: 3\n Output: (1, 2)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n Input: 12\n Output: (4, 6)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \"\"\"\n", "solution": "def even_odd_palindrome(n):\n even_count = 0\n odd_count = 0\n for i in range(1, n + 1):\n s = str(i)\n if s == s[::-1]:\n if int(s) % 2 == 0:\n even_count += 1\n else:\n odd_count += 1\n return (even_count, odd_count)", "passes": true, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
281
|
+
{"id": "code-verifier/280", "task_id": "HumanEval/64", "entry_point": "vowels_count", "prompt": "\nFIX = \"\"\"\nAdd more test cases.\n\"\"\"\n\ndef vowels_count(s):\n \"\"\"Write a function vowels_count which takes a string representing\n a word as input and returns the number of vowels in the string.\n Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n vowel, but only when it is at the end of the given word.\n\n Example:\n >>> vowels_count(\"abcde\")\n 2\n >>> vowels_count(\"ACEDY\")\n 3\n \"\"\"\n", "solution": "def vowels_count(s):\n count = 0\n for ch in s:\n if ch.lower() in 'aeiou':\n count += 1\n elif ch.lower() == 'y' and s.endswith('y'):\n count += 1\n return count", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
282
|
+
{"id": "code-verifier/281", "task_id": "HumanEval/110", "entry_point": "exchange", "prompt": "\ndef exchange(lst1, lst2):\n \"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n It is assumed that the input lists will be non-empty.\n \"\"\"\n", "solution": "def exchange(lst1, lst2):\n odds_in_lst1 = sum(x % 2 != 0 for x in lst1)\n evens_in_lst2 = sum(x % 2 == 0 for x in lst2)\n return \"YES\" if odds_in_lst1 <= evens_in_lst2 else \"NO\"", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
283
|
+
{"id": "code-verifier/282", "task_id": "HumanEval/142", "entry_point": "sum_squares", "prompt": "\n\n\ndef sum_squares(lst):\n \"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n For lst = [1,2,3] the output should be 6\n For lst = [] the output should be 0\n For lst = [-1,-5,2,-1,-5] the output should be -126\n \"\"\"\n", "solution": "def sum_squares(lst):\n total = 0\n for i, val in enumerate(lst):\n if i % 3 == 0:\n total += val ** 2\n elif i % 4 == 0:\n total += val ** 3\n return total", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
284
|
+
{"id": "code-verifier/283", "task_id": "HumanEval/119", "entry_point": "match_parens", "prompt": "\ndef match_parens(lst):\n '''\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n match_parens(['()(', ')']) == 'Yes'\n match_parens([')', ')']) == 'No'\n '''\n", "solution": "def match_parens(lst):\n s1 = lst[0]\n s2 = lst[1]\n\n def is_good(s):\n balance = 0\n for char in s:\n if char == '(':\n balance += 1\n elif char == ')':\n balance -= 1\n if balance < 0:\n return False\n return balance == 0\n\n # Check all 4 possible concatenations: s1+s2 and s2+s1\n if is_good(s1 + s2) or is_good(s2 + s1):\n return 'Yes'\n else:\n return 'No'", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
285
|
+
{"id": "code-verifier/284", "task_id": "HumanEval/119", "entry_point": "match_parens", "prompt": "\ndef match_parens(lst):\n '''\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n match_parens(['()(', ')']) == 'Yes'\n match_parens([')', ')']) == 'No'\n '''\n", "solution": "def match_parens(lst):\n if len(lst) != 2:\n return 'No'\n a, b = lst[0], lst[1]\n open_a = a.count('(')\n close_a = a.count(')')\n open_b = b.count('(')\n close_b = b.count(')')\n total_open = open_a + open_b\n total_close = close_a + close_b\n if total_open != total_close:\n return 'No'\n bal = 0\n min_bal = 0\n for ch in a:\n bal += 1 if ch == '(' else -1\n if bal < min_bal:\n min_bal = bal\n bal_a = open_a - close_a\n if min(min_bal, min_bal + bal_a) >= 0:\n return 'Yes'\n bal_b = open_b - close_b\n if min(min_bal + bal_b, min_bal) >= 0:\n return 'Yes'\n return 'No'", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
286
|
+
{"id": "code-verifier/285", "task_id": "HumanEval/125", "entry_point": "split_words", "prompt": "\ndef split_words(txt):\n '''\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n split_words(\"Hello world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"Hello,world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"abcdef\") == 3 \n '''\n", "solution": "def split_words(txt):\n if ' ' in txt:\n return txt.split()\n elif ',' in txt:\n return txt.split(',')\n else:\n return sum(1 for c in txt if c.islower() and (ord(c) - ord('a')) % 2 == 1)", "passes": true, "model": "ornith-35b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
287
|
+
{"id": "code-verifier/286", "task_id": "HumanEval/115", "entry_point": "max_fill", "prompt": "import math\n\ndef max_fill(grid, capacity):\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n Input: \n grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n bucket_capacity : 1\n Output: 6\n\n Example 2:\n Input: \n grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n bucket_capacity : 2\n Output: 5\n \n Example 3:\n Input: \n grid : [[0,0,0], [0,0,0]]\n bucket_capacity : 5\n Output: 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n", "solution": "import math\n\ndef max_fill(grid, capacity):\n total_water = sum(sum(row) for row in grid)\n return (total_water + capacity - 1) // capacity", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
288
|
+
{"id": "code-verifier/287", "task_id": "HumanEval/133", "entry_point": "sum_squares", "prompt": "\n\ndef sum_squares(lst):\n \"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n For lst = [1,2,3] the output should be 14\n For lst = [1,4,9] the output should be 98\n For lst = [1,3,5,7] the output should be 84\n For lst = [1.4,4.2,0] the output should be 29\n For lst = [-2.4,1,1] the output should be 6\n \n\n \"\"\"\n", "solution": "\n\ndef sum_squares(lst):\n \"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n For lst = [1,2,3] the output should be 14\n For lst = [1,4,9] the output should be 98\n For lst = [1,3,5,7] the output should be 84\n For lst = [1.4,4.2,0] the output should be 29\n For lst = [-2.4,1,1] the output should be 6\n \n\n \"\"\"\n import math\n squared_sum = 0\n for num in lst:\n ceiled_num = math.ceil(num)\n squared_sum += ceiled_num ** 2\n return squared_sum", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
289
|
+
{"id": "code-verifier/288", "task_id": "HumanEval/93", "entry_point": "encode", "prompt": "\ndef encode(message):\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \"\"\"\n", "solution": "def encode(message):\n vowels = set('AEIOUaeiou')\n result = []\n for ch in message:\n if ch.isalpha():\n swapped = ch.swapcase()\n if ch in vowels:\n base = ord('A') if ch.isupper() else ord('a')\n shifted_ord = (ord(ch) - base + 2) % 26 + base\n result.append(chr(shifted_ord))\n else:\n result.append(swapped)\n else:\n result.append(ch.swapcase())\n return ''.join(result)", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
290
|
+
{"id": "code-verifier/289", "task_id": "HumanEval/141", "entry_point": "file_name_check", "prompt": "\ndef file_name_check(file_name):\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n file_name_check(\"example.txt\") # => 'Yes'\n file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n \"\"\"\n", "solution": "import re\n\ndef file_name_check(file_name):\n if file_name.count('.') != 1:\n return 'No'\n\n parts = file_name.split('.')\n name_part = parts[0]\n extension = parts[1]\n\n if not name_part:\n return 'No'\n\n # Condition 3: The substring before the dot should not be empty, and it starts with a letter from the latin alphapet ('a'-'z' and 'A'-'Z').\n if not name_part[0].isalpha():\n return 'No'\n\n # Condition 1: There should not be more than three digits ('0'-'9') in the file's name.\n digit_count = sum(1 for char in name_part if char.isdigit())\n if digit_count > 3:\n return 'No'\n\n # Condition 4: The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n valid_extensions = ['txt', 'exe', 'dll']\n if extension not in valid_extensions:\n return 'No'\n\n return 'Yes'", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
291
|
+
{"id": "code-verifier/290", "task_id": "HumanEval/65", "entry_point": "circular_shift", "prompt": "\ndef circular_shift(x, shift):\n \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n \"21\"\n >>> circular_shift(12, 2)\n \"12\"\n \"\"\"\n", "solution": "def circular_shift(x, shift):\n digits = str(x)\n n = len(digits)\n if shift > n:\n shift = n - shift\n shifted_digits = digits[-shift:] + digits[:-shift]\n return shifted_digits", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
292
|
+
{"id": "code-verifier/291", "task_id": "HumanEval/130", "entry_point": "tri", "prompt": "\ndef tri(n):\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\n", "solution": "def tri(n):\n if n == 0:\n return [1]\n if n == 1:\n return [1, 3]\n result = [1, 3]\n for i in range(2, n + 1):\n if i % 2 == 0:\n result.append(1 + i // 2)\n else:\n result.append(result[-1] + result[-2] + 1 + (i + 1) // 2)\n return result", "passes": true, "model": "qwen3.8-27b-mtp-medium", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
293
|
+
{"id": "code-verifier/292", "task_id": "HumanEval/59", "entry_point": "largest_prime_factor", "prompt": "\n\ndef largest_prime_factor(n: int):\n \"\"\"Return the largest prime factor of n. Assume n > 1 and is not a prime.\n >>> largest_prime_factor(13195)\n 29\n >>> largest_prime_factor(2048)\n 2\n \"\"\"\n", "solution": "def largest_prime_factor(n: int):\n i = 2\n while i * i <= n:\n if n % i == 0:\n max_factor = i\n while n % i == 0:\n n //= i\n i += 1 if i == 2 else 2\n return max_factor", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
294
|
+
{"id": "code-verifier/293", "task_id": "HumanEval/81", "entry_point": "numerical_letter_grade", "prompt": "\ndef numerical_letter_grade(grades):\n \"\"\"It is the last week of the semester and the teacher has to give the grades\n to students. The teacher has been making her own algorithm for grading.\n The only problem is, she has lost the code she used for grading.\n She has given you a list of GPAs for some students and you have to write \n a function that can output a list of letter grades using the following table:\n GPA | Letter grade\n 4.0 A+\n > 3.7 A \n > 3.3 A- \n > 3.0 B+\n > 2.7 B \n > 2.3 B-\n > 2.0 C+\n > 1.7 C\n > 1.3 C-\n > 1.0 D+ \n > 0.7 D \n > 0.0 D-\n 0.0 E\n \n\n Example:\n grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n \"\"\"\n", "solution": "def numerical_letter_grade(grades):\n result = []\n for gpa in grades:\n if gpa >= 4.0:\n result.append('A+')\n elif gpa > 3.7:\n result.append('A')\n elif gpa > 3.3:\n result.append('A-')\n elif gpa > 3.0:\n result.append('B+')\n elif gpa > 2.7:\n result.append('B')\n elif gpa > 2.3:\n result.append('B-')\n elif gpa > 2.0:\n result.append('C+')\n elif gpa > 1.7:\n result.append('C')\n elif gpa > 1.3:\n result.append('C-')\n elif gpa > 1.0:\n result.append('D+')\n elif gpa > 0.7:\n result.append('D')\n elif gpa > 0.0:\n result.append('D-')\n else:\n result.append('E')\n return result", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
295
|
+
{"id": "code-verifier/294", "task_id": "HumanEval/119", "entry_point": "match_parens", "prompt": "\ndef match_parens(lst):\n '''\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n match_parens(['()(', ')']) == 'Yes'\n match_parens([')', ')']) == 'No'\n '''\n", "solution": "def match_parens(lst):\n s1, s2 = lst[0], lst[1]\n combined = s1 + s2\n balance = 0\n for char in combined:\n if char == '(':\n balance += 1\n else:\n balance -= 1\n if balance < 0:\n return 'No'\n return 'Yes' if balance == 0 else 'No'", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
296
|
+
{"id": "code-verifier/295", "task_id": "HumanEval/116", "entry_point": "sort_array", "prompt": "\ndef sort_array(arr):\n \"\"\"\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n \"\"\"\n", "solution": "def sort_array(arr):\n def key_func(x):\n # Count number of ones in binary representation\n ones = bin(x).count('1')\n # For negative numbers, we treat them as positive? But problem says non-negative integers.\n # So assume arr contains non-negative integers.\n return (ones, x)\n return sorted(arr, key=key_func)", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
297
|
+
{"id": "code-verifier/296", "task_id": "HumanEval/87", "entry_point": "get_row", "prompt": "\ndef get_row(lst, x):\n \"\"\"\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n get_row([\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n get_row([], 1) == []\n get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n \"\"\"\n", "solution": "\ndef get_row(lst, x):\n \"\"\"\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n get_row([\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n get_row([], 1) == []\n get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n \"\"\"\n results = []\n for r, row in enumerate(lst):\n for c, val in enumerate(row):\n if val == x:\n results.append((r, c))\n\n results.sort(key=lambda item: item[0])\n results.sort(key=lambda item: item[1], reverse=True)\n return results", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
298
|
+
{"id": "code-verifier/297", "task_id": "HumanEval/147", "entry_point": "get_max_triples", "prompt": "\ndef get_max_triples(n):\n \"\"\"\n You are given a positive integer n. You have to create an integer array a of length n.\n For each i (1 ≤ i ≤ n), the value of a[i] = i * i - i + 1.\n Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, \n and a[i] + a[j] + a[k] is a multiple of 3.\n\n Example :\n Input: n = 5\n Output: 1\n Explanation: \n a = [1, 3, 7, 13, 21]\n The only valid triple is (1, 7, 13).\n \"\"\"\n", "solution": "def get_max_triples(n):\n counts = [0] * 3\n for i in range(1, n + 1):\n a_i = i * i - i + 1\n remainder = a_i % 3\n counts[remainder] += 1\n\n total_triples = 0\n\n # Case 1: All three elements have the same remainder (r + r + r = 3r = 0 mod 3)\n for r in range(3):\n if counts[r] >= 3:\n total_triples += counts[r] * (counts[r] - 1) * (counts[r] - 2) // 6\n\n # Case 2: The three elements have remainders (0, 1, 2) in any order (0 + 1 + 2 = 3 = 0 mod 3)\n # We need to choose one element from each group.\n # Number of ways to choose one from each group: counts[0] * counts[1] * counts[2]\n total_triples += counts[0] * counts[1] * counts[2]\n\n return total_triples", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
299
|
+
{"id": "code-verifier/298", "task_id": "HumanEval/135", "entry_point": "can_arrange", "prompt": "\ndef can_arrange(arr):\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \"\"\"\n", "solution": "def can_arrange(arr):\n for i in range(1, len(arr)):\n if arr[i] < arr[i-1]:\n return i\n return -1", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
300
|
+
{"id": "code-verifier/299", "task_id": "HumanEval/72", "entry_point": "will_it_fly", "prompt": "\ndef will_it_fly(q,w):\n '''\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n will_it_fly([1, 2], 5) ➞ False \n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n will_it_fly([3, 2, 3], 1) ➞ False\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n will_it_fly([3, 2, 3], 9) ➞ True\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n will_it_fly([3], 5) ➞ True\n # 3 is less than the maximum possible weight, and it's balanced.\n '''\n", "solution": "def will_it_fly(q,w):\n if q == q[::-1]:\n total = sum(q)\n return total <= w\n else:\n return False", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
301
|
+
{"id": "code-verifier/300", "task_id": "HumanEval/115", "entry_point": "max_fill", "prompt": "import math\n\ndef max_fill(grid, capacity):\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n Input: \n grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n bucket_capacity : 1\n Output: 6\n\n Example 2:\n Input: \n grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n bucket_capacity : 2\n Output: 5\n \n Example 3:\n Input: \n grid : [[0,0,0], [0,0,0]]\n bucket_capacity : 5\n Output: 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n", "solution": "import math\n\ndef max_fill(grid, capacity):\n total = sum(sum(row) for row in grid)\n return (total + capacity - 1) // capacity", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
302
|
+
{"id": "code-verifier/301", "task_id": "HumanEval/127", "entry_point": "intersection", "prompt": "\ndef intersection(interval1, interval2):\n \"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n intersection((1, 2), (2, 3)) ==> \"NO\"\n intersection((-1, 1), (0, 4)) ==> \"NO\"\n intersection((-3, -1), (-5, 5)) ==> \"YES\"\n \"\"\"\n", "solution": "def intersection(interval1, interval2):\n s1, e1 = interval1\n s2, e2 = interval2\n left = max(s1, s2)\n right = min(e1, e2)\n if left > right:\n return \"NO\"\n length = right - left\n if length < 2:\n return \"NO\"\n for i in range(2, int(length**0.5) + 1):\n if length % i == 0:\n return \"NO\"\n return \"YES\"", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
303
|
+
{"id": "code-verifier/302", "task_id": "HumanEval/100", "entry_point": "make_a_pile", "prompt": "\ndef make_a_pile(n):\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n", "solution": "\ndef make_a_pile(n):\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n if n <= 0:\n return []\n levels = [n]\n current_n = n\n while len(levels) < n + 1:\n if current_n % 2 != 0:\n next_level = current_n + 2\n else:\n next_level = current_n + 1\n levels.append(next_level)\n current_n = next_level\n return levels", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
304
|
+
{"id": "code-verifier/303", "task_id": "HumanEval/159", "entry_point": "eat", "prompt": "\ndef eat(number, need, remaining):\n \"\"\"\n You're a hungry rabbit, and you already have eaten a certain number of carrots,\n but now you need to eat more carrots to complete the day's meals.\n you should return an array of [ total number of eaten carrots after your meals,\n the number of carrots left after your meals ]\n if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n \n Example:\n * eat(5, 6, 10) -> [11, 4]\n * eat(4, 8, 9) -> [12, 1]\n * eat(1, 10, 10) -> [11, 0]\n * eat(2, 11, 5) -> [7, 0]\n \n Variables:\n @number : integer\n the number of carrots that you have eaten.\n @need : integer\n the number of carrots that you need to eat.\n @remaining : integer\n the number of remaining carrots thet exist in stock\n \n Constrain:\n * 0 <= number <= 1000\n * 0 <= need <= 1000\n * 0 <= remaining <= 1000\n\n Have fun :)\n \"\"\"\n", "solution": "def eat(number, need, remaining):\n total_needed = number + need\n if remaining >= need:\n eaten = need\n remaining_after = remaining - need\n else:\n eaten = remaining\n remaining_after = 0\n total = number + eaten\n return [total, remaining_after]", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
305
|
+
{"id": "code-verifier/304", "task_id": "HumanEval/102", "entry_point": "choose_num", "prompt": "\ndef choose_num(x, y):\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n", "solution": "def choose_num(x, y):\n if x > y:\n return -1\n # Ensure the range is valid (x <= y)\n start = min(x, y)\n end = max(x, y)\n # Find the largest even number in [start, end]\n if start % 2 == 0:\n return start\n else:\n candidate = start + 1\n if candidate > end:\n return -1\n return candidate if candidate % 2 == 0 else (candidate - 1)", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
306
|
+
{"id": "code-verifier/305", "task_id": "HumanEval/33", "entry_point": "sort_third", "prompt": "\n\ndef sort_third(l: list):\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n to the values of the corresponding indicies of l, but sorted.\n >>> sort_third([1, 2, 3])\n [1, 2, 3]\n >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n [2, 6, 3, 4, 8, 9, 5]\n \"\"\"\n", "solution": "def sort_third(l: list):\n thirds = sorted([l[i] for i in range(0, len(l), 3)])\n result = []\n idx = 0\n for i in range(len(l)):\n if i % 3 == 0:\n result.append(thirds.pop(0))\n else:\n result.append(l[i])\n return result", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
307
|
+
{"id": "code-verifier/306", "task_id": "HumanEval/62", "entry_point": "derivative", "prompt": "\n\ndef derivative(xs: list):\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\n", "solution": "\n\ndef derivative(xs: list):\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\n if len(xs) <= 1:\n return []\n return [xs[i] * (i + 1) for i in range(len(xs) - 1)]", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
308
|
+
{"id": "code-verifier/307", "task_id": "HumanEval/102", "entry_point": "choose_num", "prompt": "\ndef choose_num(x, y):\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n", "solution": "\ndef choose_num(x, y):\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n if x > y:\n return -1\n for i in range(int(y), int(x) - 1, -1):\n if i % 2 == 0:\n return i\n return -1", "passes": true, "model": "ornith-35b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
309
|
+
{"id": "code-verifier/308", "task_id": "HumanEval/162", "entry_point": "string_to_md5", "prompt": "\ndef string_to_md5(text):\n \"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n \"\"\"\n", "solution": "def string_to_md5(text):\n if not text:\n return None\n return hashlib.md5(text.encode('utf-8')).hexdigest()", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
310
|
+
{"id": "code-verifier/309", "task_id": "HumanEval/122", "entry_point": "add_elements", "prompt": "\ndef add_elements(arr, k):\n \"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n Output: 24 # sum of 21 + 3\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\n", "solution": "def add_elements(arr, k):\n total = 0\n for i in range(k):\n num = arr[i]\n if abs(num) < 100:\n total += num\n return total", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
311
|
+
{"id": "code-verifier/310", "task_id": "HumanEval/127", "entry_point": "intersection", "prompt": "\ndef intersection(interval1, interval2):\n \"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n intersection((1, 2), (2, 3)) ==> \"NO\"\n intersection((-1, 1), (0, 4)) ==> \"NO\"\n intersection((-3, -1), (-5, 5)) ==> \"YES\"\n \"\"\"\n", "solution": "def intersection(interval1, interval2):\n start = max(interval1[0], interval2[0])\n end = min(interval1[1], interval2[1])\n if start > end:\n return \"NO\"\n length = end - start + 1\n if length < 2:\n return \"NO\"\n is_prime = True\n for i in range(2, int(length**0.5) + 1):\n if length % i == 0:\n is_prime = False\n break\n return \"YES\" if is_prime else \"NO\"", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
312
|
+
{"id": "code-verifier/311", "task_id": "HumanEval/106", "entry_point": "f", "prompt": "\ndef f(n):\n \"\"\" Implement the function f that takes n as a parameter,\n and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n f(5) == [1, 2, 6, 24, 15]\n \"\"\"\n", "solution": "def f(n):\n result = []\n for i in range(1, n+1):\n if i % 2 == 0:\n val = 1\n for k in range(1, i+1):\n val *= k\n else:\n val = sum(range(1, i+1))\n result.append(val)\n return result", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
313
|
+
{"id": "code-verifier/312", "task_id": "HumanEval/151", "entry_point": "double_the_difference", "prompt": "\ndef double_the_difference(lst):\n '''\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n double_the_difference([-1, -2, 0]) == 0\n double_the_difference([9, -2]) == 81\n double_the_difference([0]) == 0 \n \n If the input list is empty, return 0.\n '''\n", "solution": "\ndef double_the_difference(lst):\n '''\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n double_the_difference([-1, -2, 0]) == 0\n double_the_difference([9, -2]) == 81\n double_the_difference([0]) == 0 \n \n If the input list is empty, return 0.\n '''\n total = 0\n for x in lst:\n if type(x) is int and x >= 0 and x % 2 != 0:\n total += x * x\n return total", "passes": false, "model": "minicpm5-2b-q8-bench-rp110", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
314
|
+
{"id": "code-verifier/313", "task_id": "HumanEval/100", "entry_point": "make_a_pile", "prompt": "\ndef make_a_pile(n):\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n", "solution": "def make_a_pile(n):\n return [n + 2 * i for i in range(n)]", "passes": true, "model": "qwen3.8-27b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
315
|
+
{"id": "code-verifier/314", "task_id": "HumanEval/55", "entry_point": "fib", "prompt": "\n\ndef fib(n: int):\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n", "solution": "\n\ndef fib(n: int):\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n if n <= 2:\n return 1\n a, b = 1, 1\n for _ in range(3, n + 1):\n a, b = b, a + b\n return b", "passes": false, "model": "ornith-35b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
316
|
+
{"id": "code-verifier/315", "task_id": "HumanEval/87", "entry_point": "get_row", "prompt": "\ndef get_row(lst, x):\n \"\"\"\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n get_row([\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n get_row([], 1) == []\n get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n \"\"\"\n", "solution": "def get_row(lst, x):\n \"\"\"\n You are given a 2 dimensional data, as a nested lists,\n which is similar to matrix, however, unlike matrices,\n each row may contain a different number of columns.\n Given lst, and integer x, find integers x in the list,\n and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n each tuple is a coordinate - (row, columns), starting with 0.\n Sort coordinates initially by rows in ascending order.\n Also, sort coordinates of the row by columns in descending order.\n \n Examples:\n get_row([\n [1,2,3,4,5,6],\n [1,2,3,4,1,6],\n [1,2,3,4,5,1]\n ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n get_row([], 1) == []\n get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n \"\"\"\n result = []\n for i, row in enumerate(lst):\n for j, val in enumerate(row):\n if val == x:\n result.append((i, j))\n result.sort(key=lambda coord: (coord[0], -coord[1]))\n return result", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
317
|
+
{"id": "code-verifier/316", "task_id": "HumanEval/100", "entry_point": "make_a_pile", "prompt": "\ndef make_a_pile(n):\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n", "solution": "def make_a_pile(n):\n pile = []\n if n % 2 == 0:\n current = n\n else:\n current = n + 1\n for i in range(1, n + 1):\n if i % 2 == 1:\n next_stones = current + 2 * i - 1\n else:\n next_stones = current + 2 * i\n pile.append(next_stones)\n return pile", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
318
|
+
{"id": "code-verifier/317", "task_id": "HumanEval/132", "entry_point": "is_nested", "prompt": "\ndef is_nested(string):\n '''\n Create a function that takes a string as input which contains only square brackets.\n The function should return True if and only if there is a valid subsequence of brackets \n where at least one bracket in the subsequence is nested.\n\n is_nested('[[]]') ➞ True\n is_nested('[]]]]]]][[[[[]') ➞ False\n is_nested('[][]') ➞ False\n is_nested('[]') ➞ False\n is_nested('[[][]]') ➞ True\n is_nested('[[]][[') ➞ True\n '''\n", "solution": "def is_nested(string):\n n = len(string)\n for i in range(n):\n bal = 0\n max_depth = 0\n for j in range(i, n):\n if string[j] == '[':\n bal += 1\n if bal > max_depth:\n max_depth = bal\n else:\n bal -= 1\n if bal < 0:\n break\n if bal == 0 and max_depth >= 2:\n return True\n return False", "passes": true, "model": "minicpm5-2b-q8-bench-rp110", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
319
|
+
{"id": "code-verifier/318", "task_id": "HumanEval/134", "entry_point": "check_if_last_char_is_a_letter", "prompt": "\ndef check_if_last_char_is_a_letter(txt):\n '''\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") ➞ False\n check_if_last_char_is_a_letter(\"apple pi e\") ➞ True\n check_if_last_char_is_a_letter(\"apple pi e \") ➞ False\n check_if_last_char_is_a_letter(\"\") ➞ False \n '''\n", "solution": "\ndef check_if_last_char_is_a_letter(txt):\n '''\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") ➞ False\n check_if_last_char_is_a_letter(\"apple pi e\") ➞ True\n check_if_last_char_is_a_letter(\"apple pi e \") ➞ False\n check_if_last_char_is_a_letter(\"\") ➞ False \n '''\n if not txt:\n return False\n last_char = txt[-1]\n if not last_char.isalpha():\n return False\n return len(txt) > 1 and txt[-2] == ' '", "passes": false, "model": "minicpm5-2b-q8-bench-rp110", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
320
|
+
{"id": "code-verifier/319", "task_id": "HumanEval/91", "entry_point": "is_bored", "prompt": "\ndef is_bored(S):\n \"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored(\"Hello world\")\n 0\n >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n 1\n \"\"\"\n", "solution": "import re\n\ndef is_bored(S):\n sentences = re.split(r'[.?!]', S)\n bored_count = 0\n for sentence in sentences:\n if sentence.strip().startswith(\"I \"):\n bored_count += 1\n return bored_count", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
321
|
+
{"id": "code-verifier/320", "task_id": "HumanEval/24", "entry_point": "largest_divisor", "prompt": "\n\ndef largest_divisor(n: int) -> int:\n \"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15)\n 5\n \"\"\"\n", "solution": "def largest_divisor(n: int) -> int:\n if n <= 1:\n return None\n # Start from the integer part of sqrt(n) and go downwards to find the largest divisor less than n\n i = int(n**0.5)\n while i > 1:\n if n % i == 0:\n return i\n i -= 1\n return 1", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
322
|
+
{"id": "code-verifier/321", "task_id": "HumanEval/84", "entry_point": "solve", "prompt": "\ndef solve(N):\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n For N = 1000, the sum of digits will be 1 the output should be \"1\".\n For N = 150, the sum of digits will be 6 the output should be \"110\".\n For N = 147, the sum of digits will be 12 the output should be \"1100\".\n \n Variables:\n @N integer\n Constraints: 0 ≤ N ≤ 10000.\n Output:\n a string of binary number\n \"\"\"\n", "solution": "def solve(N):\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n For N = 1000, the sum of digits will be 1 the output should be \"1\".\n For N = 150, the sum of digits will be 6 the output should be \"110\".\n For N = 147, the sum of digits will be 12 the output should be \"1100\".\n \n Variables:\n @N integer\n Constraints: 0 ≤ N ≤ 10000.\n Output:\n a string of binary number\n \"\"\"\n digit_sum = sum(int(d) for d in str(N))\n return format(digit_sum, 'b')", "passes": true, "model": "qwen3.8-27b-mtp-medium", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
323
|
+
{"id": "code-verifier/322", "task_id": "HumanEval/124", "entry_point": "valid_date", "prompt": "\ndef valid_date(date):\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n for example: \n valid_date('03-11-2000') => True\n\n valid_date('15-01-2012') => False\n\n valid_date('04-0-2040') => False\n\n valid_date('06-04-2020') => True\n\n valid_date('06/04/2020') => False\n \"\"\"\n", "solution": "def valid_date(date):\n \"\"\"You have to write a function which validates...\"\"\"\n if not date:\n return False\n\n parts = date.split('-', maxsplit=2)\n # Must split into exactly three components (month, day, year) separated by hyphens.\n if len(parts) != 3:\n return False\n\n month_str, day_str, year_str = parts\n\n # Validate format mm-dd-yyyy: both month and day must be two-digit numeric strings,\n # the year part should consist only of digits (no extra characters).\n if not (\n len(month_str) == 2\n and month_str.isdigit()\n and len(day_str) == 2\n and day_str.isdigit()\n and year_str.isdigit()):\n return False\n\n try:\n m = int(month_str)\n d = int(day_str)\n except ValueError: # Should not happen due to digit checks, but keep for safety.\n return False\n\n if not (1 <= m <= 12):\n return False\n\n # Determine maximum allowed days per month according to the given rules\n if m == 2:\n max_day = 29\n elif m in [1,3,5,7,8,10,12]:\n max_day = 31\n else: # months with up to 30 days (4,6,9,11)\n max_day = 30\n\n return d >= 1 and d <= max_day", "passes": false, "model": "minicpm5-2b-q8-bench-rp120", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
324
|
+
{"id": "code-verifier/323", "task_id": "HumanEval/141", "entry_point": "file_name_check", "prompt": "\ndef file_name_check(file_name):\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n file_name_check(\"example.txt\") # => 'Yes'\n file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n \"\"\"\n", "solution": "\ndef file_name_check(file_name):\n \"\"\"Create a function which takes a string representing a file's name, and returns\n 'Yes' if the the file's name is valid, and returns 'No' otherwise.\n A file's name is considered to be valid if and only if all the following conditions \n are met:\n - There should not be more than three digits ('0'-'9') in the file's name.\n - The file's name contains exactly one dot '.'\n - The substring before the dot should not be empty, and it starts with a letter from \n the latin alphapet ('a'-'z' and 'A'-'Z').\n - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n Examples:\n file_name_check(\"example.txt\") # => 'Yes'\n file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n \"\"\"\n digit_count = sum(c.isdigit() for c in file_name)\n if digit_count > 3:\n return 'No'\n\n if file_name.count('.') != 1:\n return 'No'\n\n parts = file_name.split('.')\n name_part = parts[0]\n extension_part = parts[1]\n\n if not name_part:\n return 'No'\n\n if not name_part[0].isalpha():\n return 'No'\n\n if extension_part not in ['txt', 'exe', 'dll']:\n return 'No'\n\n return 'Yes'", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
325
|
+
{"id": "code-verifier/324", "task_id": "HumanEval/156", "entry_point": "int_to_mini_roman", "prompt": "\ndef int_to_mini_roman(number):\n \"\"\"\n Given a positive integer, obtain its roman numeral equivalent as a string,\n and return it in lowercase.\n Restrictions: 1 <= num <= 1000\n\n Examples:\n >>> int_to_mini_roman(19) == 'xix'\n >>> int_to_mini_roman(152) == 'clii'\n >>> int_to_mini_roman(426) == 'cdxxvi'\n \"\"\"\n", "solution": "def int_to_mini_roman(number):\n roman = ''\n vals = [\n (900, 'cm'), (500, 'd'), (400, 'cd'),\n (100, 'c'), (90, 'x'), (50, 'l'),\n (40, 'xl'), (10, 'x'), (9, 'ix'),\n (5, 'v'), (1, 'i')\n ]\n for value, symbol in vals:\n while number >= value:\n roman += symbol\n number -= value\n return roman.lower()", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
326
|
+
{"id": "code-verifier/325", "task_id": "HumanEval/72", "entry_point": "will_it_fly", "prompt": "\ndef will_it_fly(q,w):\n '''\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n will_it_fly([1, 2], 5) ➞ False \n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n will_it_fly([3, 2, 3], 1) ➞ False\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n will_it_fly([3, 2, 3], 9) ➞ True\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n will_it_fly([3], 5) ➞ True\n # 3 is less than the maximum possible weight, and it's balanced.\n '''\n", "solution": "\ndef will_it_fly(q,w):\n '''\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n will_it_fly([1, 2], 5) ➞ False \n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n will_it_fly([3, 2, 3], 1) ➞ False\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n will_it_fly([3, 2, 3], 9) ➞ True\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n will_it_fly([3], 5) ➞ True\n # 3 is less than the maximum possible weight, and it's balanced.\n '''\n is_balanced = q == q[::-1]\n sum_of_elements = sum(q)\n return is_balanced and sum_of_elements <= w", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
327
|
+
{"id": "code-verifier/326", "task_id": "HumanEval/84", "entry_point": "solve", "prompt": "\ndef solve(N):\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n For N = 1000, the sum of digits will be 1 the output should be \"1\".\n For N = 150, the sum of digits will be 6 the output should be \"110\".\n For N = 147, the sum of digits will be 12 the output should be \"1100\".\n \n Variables:\n @N integer\n Constraints: 0 ≤ N ≤ 10000.\n Output:\n a string of binary number\n \"\"\"\n", "solution": "def solve(N):\n if N == 0:\n return \"0\"\n digits = []\n while N > 0:\n digits.append(str(N % 2))\n N //= 2\n result = ''.join(reversed(digits))\n print(result)\n return result", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
328
|
+
{"id": "code-verifier/327", "task_id": "HumanEval/106", "entry_point": "f", "prompt": "\ndef f(n):\n \"\"\" Implement the function f that takes n as a parameter,\n and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n f(5) == [1, 2, 6, 24, 15]\n \"\"\"\n", "solution": "def f(n):\n result = []\n for i in range(1, n + 1):\n if i % 2 == 0:\n # factorial of i\n fact = 1\n for k in range(1, i + 1):\n fact *= k\n result.append(fact)\n else:\n # sum of numbers from 1 to i\n total = i * (i + 1) // 2\n result.append(total)\n return result", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
329
|
+
{"id": "code-verifier/328", "task_id": "HumanEval/76", "entry_point": "is_simple_power", "prompt": "\ndef is_simple_power(x, n):\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \"\"\"\n", "solution": "def is_simple_power(x, n):\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \"\"\"\n if n == 0:\n return x == 0\n if n == 1:\n return x == 1\n if n == -1:\n return x in (1, -1)\n if x == 1:\n return True\n if x == 0:\n return False\n while x % n == 0:\n x //= n\n return x == 1", "passes": false, "model": "minicpm5-2b-q8-bench-rp105", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
330
|
+
{"id": "code-verifier/329", "task_id": "HumanEval/113", "entry_point": "odd_count", "prompt": "\ndef odd_count(lst):\n \"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count(['1234567'])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count(['3',\"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \"\"\"\n", "solution": "def odd_count(lst):\n result = []\n for s in lst:\n count = sum(1 for c in s if int(c) % 2 == 1)\n result.append(f\"the number of odd elements {count}n the str{count}ng {count} of the {count}nput.\")\n return result", "passes": true, "model": "qwen3.8-27b-mtp-nothink", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
331
|
+
{"id": "code-verifier/330", "task_id": "HumanEval/72", "entry_point": "will_it_fly", "prompt": "\ndef will_it_fly(q,w):\n '''\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n will_it_fly([1, 2], 5) ➞ False \n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n will_it_fly([3, 2, 3], 1) ➞ False\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n will_it_fly([3, 2, 3], 9) ➞ True\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n will_it_fly([3], 5) ➞ True\n # 3 is less than the maximum possible weight, and it's balanced.\n '''\n", "solution": "\ndef will_it_fly(q,w):\n '''\n Write a function that returns True if the object q will fly, and False otherwise.\n The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n Example:\n will_it_fly([1, 2], 5) ➞ False \n # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n will_it_fly([3, 2, 3], 1) ➞ False\n # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n will_it_fly([3, 2, 3], 9) ➞ True\n # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n will_it_fly([3], 5) ➞ True\n # 3 is less than the maximum possible weight, and it's balanced.\n '''\n return len(q) > 0 and q == q[::-1] and sum(q) <= w", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
332
|
+
{"id": "code-verifier/331", "task_id": "HumanEval/126", "entry_point": "is_sorted", "prompt": "\ndef is_sorted(lst):\n '''\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) ➞ True\n is_sorted([1, 2, 3, 4, 5]) ➞ True\n is_sorted([1, 3, 2, 4, 5]) ➞ False\n is_sorted([1, 2, 3, 4, 5, 6]) ➞ True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) ➞ True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) ➞ False\n is_sorted([1, 2, 2, 3, 3, 4]) ➞ True\n is_sorted([1, 2, 2, 2, 3, 4]) ➞ False\n '''\n", "solution": "def is_sorted(lst):\n if len(lst) <= 1:\n return True\n for i in range(len(lst) - 1):\n if lst[i] > lst[i + 1]:\n return False\n counts = {}\n for num in lst:\n counts[num] = counts.get(num, 0) + 1\n if counts[num] > 2:\n return False\n return True", "passes": true, "model": "qwen3.8-27b-mtp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
333
|
+
{"id": "code-verifier/332", "task_id": "HumanEval/151", "entry_point": "double_the_difference", "prompt": "\ndef double_the_difference(lst):\n '''\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n double_the_difference([-1, -2, 0]) == 0\n double_the_difference([9, -2]) == 81\n double_the_difference([0]) == 0 \n \n If the input list is empty, return 0.\n '''\n", "solution": "def double_the_difference(lst):\n return sum(x**2 for x in lst if isinstance(x, int) and x % 2 != 0)", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
334
|
+
{"id": "code-verifier/333", "task_id": "HumanEval/41", "entry_point": "car_race_collision", "prompt": "\n\ndef car_race_collision(n: int):\n \"\"\"\n Imagine a road that's a perfectly straight infinitely long line.\n n cars are driving left to right; simultaneously, a different set of n cars\n are driving right to left. The two sets of cars start out being very far from\n each other. All cars move in the same speed. Two cars are said to collide\n when a car that's moving left to right hits a car that's moving right to left.\n However, the cars are infinitely sturdy and strong; as a result, they continue moving\n in their trajectory as if they did not collide.\n\n This function outputs the number of such collisions.\n \"\"\"\n", "solution": "def car_race_collision(n: int):\n \"\"\"\n Imagine a road that's...\n ...\n This function outputs the number of such collisions.\n \"\"\"\n return n * n", "passes": true, "model": "minicpm5-2b-q8-bench-rp115", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
335
|
+
{"id": "code-verifier/334", "task_id": "HumanEval/163", "entry_point": "generate_integers", "prompt": "\ndef generate_integers(a, b):\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\n", "solution": "def generate_integers(a,b):\n lower = min(a,b)\n upper = max(a,b)\n return [num for num in range(lower, upper+1) if num % 2 == 0 and num < 10]", "passes": false, "model": "minicpm5-2b-q4-bench-rp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
336
|
+
{"id": "code-verifier/335", "task_id": "HumanEval/143", "entry_point": "words_in_sentence", "prompt": "\ndef words_in_sentence(sentence):\n \"\"\"\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n Input: sentence = \"This is a test\"\n Output: \"is\"\n\n Example 2:\n Input: sentence = \"lets go for swimming\"\n Output: \"go for\"\n\n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \"\"\"\n", "solution": "def words_in_sentence(sentence):\n def is_prime(n):\n if n < 2:\n return False\n for i in range(2, int(n**0.5)+1):\n if n % i == 0:\n return False\n return True\n words = sentence.split()\n filtered = [w for w in words if is_prime(len(w))]\n return ' '.join(filtered)", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
337
|
+
{"id": "code-verifier/336", "task_id": "HumanEval/154", "entry_point": "cycpattern_check", "prompt": "\ndef cycpattern_check(a , b):\n \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n cycpattern_check(\"abcd\",\"abd\") => False\n cycpattern_check(\"hello\",\"ell\") => True\n cycpattern_check(\"whassup\",\"psus\") => False\n cycpattern_check(\"abab\",\"baa\") => True\n cycpattern_check(\"efef\",\"eeff\") => False\n cycpattern_check(\"himenss\",\"simen\") => True\n\n \"\"\"\n", "solution": "\ndef cycpattern_check(a , b):\n \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n cycpattern_check(\"abcd\",\"abd\") => False\n cycpattern_check(\"hello\",\"ell\") => True\n cycpattern_check(\"whassup\",\"psus\") => False\n cycpattern_check(\"abab\",\"baa\") => True\n cycpattern_check(\"efef\",\"eeff\") => False\n cycpattern_check(\"himenss\",\"simen\") => True\n\n \"\"\"\n for i in range(len(b)):\n if (b[i:] + b[:i]) in a:\n return True\n return False", "passes": false, "model": "qwen3.8-27b-mtp-xhigh", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
338
|
+
{"id": "code-verifier/337", "task_id": "HumanEval/111", "entry_point": "histogram", "prompt": "\ndef histogram(test):\n \"\"\"Given a string representing a space separated lowercase letters, return a dictionary\n of the letter with the most repetition and containing the corresponding count.\n If several letters have the same occurrence, return all of them.\n \n Example:\n histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n histogram('a b b a') == {'a': 2, 'b': 2}\n histogram('a b c a b') == {'a': 2, 'b': 2}\n histogram('b b b b a') == {'b': 4}\n histogram('') == {}\n\n \"\"\"\n", "solution": "def histogram(test):\n if not test:\n return {}\n counts = {}\n for char in test.split():\n counts[char] = counts.get(char, 0) + 1\n max_count = max(counts.values())\n result = {char: count for char, count in counts.items() if count == max_count}\n return result", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
339
|
+
{"id": "code-verifier/338", "task_id": "HumanEval/113", "entry_point": "odd_count", "prompt": "\ndef odd_count(lst):\n \"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count(['1234567'])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count(['3',\"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \"\"\"\n", "solution": "def odd_count(lst):\n result = []\n for s in lst:\n count = sum(1 for ch in s if int(ch) % 2 == 1)\n result.append(f\"the number of odd elements {count}n the str{len(result)+1}ng {len(result)+1} of the input.\")\n return result", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
340
|
+
{"id": "code-verifier/339", "task_id": "HumanEval/99", "entry_point": "closest_integer", "prompt": "\ndef closest_integer(value):\n '''\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n '''\n", "solution": "\ndef closest_integer(value):\n '''\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n '''\n num = float(value)\n if num >= 0:\n return int(num + 0.5)\n else:\n return int(num - 0.5)", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
341
|
+
{"id": "code-verifier/340", "task_id": "HumanEval/1", "entry_point": "separate_paren_groups", "prompt": "from typing import List\n\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n", "solution": "from typing import List\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n result = []\n stack = [0] # Stack to track the start index of each group, initialized with a dummy 0\n for i, char in enumerate(paren_string):\n if char == '(':\n stack.append(i)\n elif char == ')':\n start = stack.pop()\n result.append(paren_string[start:i+1])\n return result", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
342
|
+
{"id": "code-verifier/341", "task_id": "HumanEval/40", "entry_point": "triples_sum_to_zero", "prompt": "\n\ndef triples_sum_to_zero(l: list):\n \"\"\"\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n >>> triples_sum_to_zero([1, 3, 5, 0])\n False\n >>> triples_sum_to_zero([1, 3, -2, 1])\n True\n >>> triples_sum_to_zero([1, 2, 3, 7])\n False\n >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n True\n >>> triples_sum_to_zero([1])\n False\n \"\"\"\n", "solution": "def triples_sum_to_zero(l: list):\n \"\"\"\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n >>> triples_sum_to_zero([1, 3, 5, 0])\n False\n >>> triples_sum_to_zero([1, 3, -2, 1])\n True\n >>> triples_sum_to_zero([1, 2, 3, 7])\n False\n >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n True\n >>> triples_sum_to_zero([1])\n False\n \"\"\"\n n = len(l)\n for i in range(n):\n for j in range(i + 1, n):\n for k in range(j + 1, n):\n if l[i] + l[j] + l[k] == 0:\n return True\n return False", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
343
|
+
{"id": "code-verifier/342", "task_id": "HumanEval/89", "entry_point": "encrypt", "prompt": "\ndef encrypt(s):\n \"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n encrypt('hi') returns 'lm'\n encrypt('asdfghjkl') returns 'ewhjklnop'\n encrypt('gf') returns 'kj'\n encrypt('et') returns 'ix'\n \"\"\"\n", "solution": "def encrypt(s):\n result = []\n for char in s:\n if 'a' <= char <= 'z':\n shifted = (ord(char) - ord('a') + 4) % 26\n result.append(chr(shifted + ord('a')))\n elif 'A' <= char <= 'Z':\n shifted = (ord(char) - ord('A') + 4) % 26\n result.append(chr(shifted + ord('A')))\n return ''.join(result)", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
344
|
+
{"id": "code-verifier/343", "task_id": "HumanEval/139", "entry_point": "special_factorial", "prompt": "\ndef special_factorial(n):\n \"\"\"The Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n >>> special_factorial(4)\n 288\n\n The function will receive an integer as input and should return the special\n factorial of this integer.\n \"\"\"\n", "solution": "def special_factorial(n):\n prod = 1\n fact = 1\n for i in range(1, n+1):\n fact *= i\n prod *= fact\n return prod", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
345
|
+
{"id": "code-verifier/344", "task_id": "HumanEval/162", "entry_point": "string_to_md5", "prompt": "\ndef string_to_md5(text):\n \"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n \"\"\"\n", "solution": "\ndef string_to_md5(text):\n \"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n \"\"\"\n if not text:\n return None\n import hashlib\n return hashlib.md5(text.encode('utf-8')).hexdigest", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
346
|
+
{"id": "code-verifier/345", "task_id": "HumanEval/10", "entry_point": "make_palindrome", "prompt": "\n\ndef is_palindrome(string: str) -> bool:\n \"\"\" Test if given string is a palindrome \"\"\"\n return string == string[::-1]\n\n\ndef make_palindrome(string: str) -> str:\n \"\"\" Find the shortest palindrome that begins with a supplied string.\n Algorithm idea is simple:\n - Find the longest postfix of supplied string that is a palindrome.\n - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n >>> make_palindrome('')\n ''\n >>> make_palindrome('cat')\n 'catac'\n >>> make_palindrome('cata')\n 'catac'\n \"\"\"\n", "solution": "def make_palindrome(string: str) -> str:\n n = len(string)\n for i in range(n):\n prefix = string[:i]\n suffix = string[i:]\n if suffix == prefix[::-1]:\n return string\n \n # Find the longest palindromic suffix\n for i in range(n):\n suffix = string[i:]\n if suffix == suffix[::-1]:\n # The part before the palindromic suffix is string[:i]\n # We need to reverse this prefix and append it to the original string\n return string + string[:i][::-1]\n \n # This part should theoretically not be reached if the logic above is correct,\n # but as a fallback, return the original string or handle error.\n # Based on the problem description, a palindrome can always be formed.\n return string + string[::-1]", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
347
|
+
{"id": "code-verifier/346", "task_id": "HumanEval/32", "entry_point": "find_zero", "prompt": "import math\n\n\ndef poly(xs: list, x: float):\n \"\"\"\n Evaluates polynomial with coefficients xs at point x.\n return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n\n \"\"\"\n return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)])\n\n\ndef find_zero(xs: list):\n \"\"\" xs are coefficients of a polynomial.\n find_zero find x such that poly(x) = 0.\n find_zero returns only only zero point, even if there are many.\n Moreover, find_zero only takes list xs having even number of coefficients\n and largest non zero coefficient as it guarantees\n a solution.\n >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x\n -0.5\n >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3\n 1.0\n \"\"\"\n", "solution": "import math\n\ndef find_zero(xs: list):\n \"\"\" xs are coefficients of a polynomial.\n find_zero find x such that poly(x) = 0.\n find_zero returns only only zero point, even if there are many.\n Moreover, find_zero only takes list xs having even number of coefficients\n and largest non zero coefficient as it guarantees\n a solution.\n >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x\n -0.5\n >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3\n 1.0\n \"\"\"\n step = 0.1\n prev_x = -1000.0\n prev_y = poly(xs, prev_x)\n for i in range(1, 20001):\n x = prev_x + step\n y = poly(xs, x)\n if abs(y) < 0.001:\n return x\n if prev_y * y < 0:\n a, b = prev_x, x\n for _ in range(50):\n mid = (a + b) / 2\n fm = poly(xs, mid)\n if abs(fm) < 1e-10:\n return mid\n if poly(xs, a) * fm < 0:\n b = mid\n else:\n a = mid\n return (a + b) / 2\n prev_x = x\n prev_y = y\n return 0.0", "passes": false, "model": "qwen3.8-27b-mtp-medium", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
348
|
+
{"id": "code-verifier/347", "task_id": "HumanEval/107", "entry_point": "even_odd_palindrome", "prompt": "\ndef even_odd_palindrome(n):\n \"\"\"\n Given a positive integer n, return a tuple that has the number of even and odd\n integer palindromes that fall within the range(1, n), inclusive.\n\n Example 1:\n\n Input: 3\n Output: (1, 2)\n Explanation:\n Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n Example 2:\n\n Input: 12\n Output: (4, 6)\n Explanation:\n Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n Note:\n 1. 1 <= n <= 10^3\n 2. returned tuple has the number of even and odd integer palindromes respectively.\n \"\"\"\n", "solution": "def even_odd_palindrome(n):\n even = odd = 0\n for i in range(1, n+1):\n s = str(i)\n if s == s[::-1]:\n if i % 2 == 0:\n even += 1\n else:\n odd += 1\n return (even, odd)", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
349
|
+
{"id": "code-verifier/348", "task_id": "HumanEval/39", "entry_point": "prime_fib", "prompt": "\n\ndef prime_fib(n: int):\n \"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\n", "solution": "def prime_fib(n: int):\n count = 0\n a, b = 0, 1\n while True:\n if a > 1:\n is_prime = True\n i = 2\n while i * i <= a:\n if a % i == 0:\n is_prime = False\n break\n i += 1\n if is_prime:\n count += 1\n if count == n:\n return a\n a, b = b, a + b", "passes": false, "model": "ornith-35b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
350
|
+
{"id": "code-verifier/349", "task_id": "HumanEval/104", "entry_point": "unique_digits", "prompt": "\ndef unique_digits(x):\n \"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n >>> unique_digits([152, 323, 1422, 10])\n []\n \"\"\"\n", "solution": "def unique_digits(x):\n result = []\n for num in x:\n s = str(num)\n if all(ch in '13579' for ch in s):\n result.append(num)\n return sorted(result)", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
351
|
+
{"id": "code-verifier/350", "task_id": "HumanEval/71", "entry_point": "triangle_area", "prompt": "\ndef triangle_area(a, b, c):\n '''\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n triangle_area(3, 4, 5) == 6.00\n triangle_area(1, 2, 10) == -1\n '''\n", "solution": "def triangle_area(a, b, c):\n if a + b > c and a + c > b and b + c > a:\n area = 6 * ((a*b) / (a + b + c)) ** 0.5\n return round(area, 2)\n else:\n return -1", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
352
|
+
{"id": "code-verifier/351", "task_id": "HumanEval/138", "entry_point": "is_equal_to_sum_even", "prompt": "\ndef is_equal_to_sum_even(n):\n \"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n is_equal_to_sum_even(4) == False\n is_equal_to_sum_even(6) == False\n is_equal_to_sum_even(8) == True\n \"\"\"\n", "solution": "\ndef is_equal_to_sum_even(n):\n \"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n Example\n is_equal_to_sum_even(4) == False\n is_equal_to_sum_even(6) == False\n is_equal_to_sum_even(8) == True\n \"\"\"\n if n < 8:\n return False\n return n % 2 == 0", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
353
|
+
{"id": "code-verifier/352", "task_id": "HumanEval/160", "entry_point": "do_algebra", "prompt": "\ndef do_algebra(operator, operand):\n \"\"\"\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \"\"\"\n", "solution": "def do_algebra(operator, operand):\n ops = {\n '+': lambda a,b: a + b,\n '-': lambda a,b: a - b,\n '*': lambda a,b: a * b,\n '//': lambda a,b: a // b,\n '**': lambda a,b: a ** b\n }\n result = operand[0]\n for op, val in zip(operator, operand[1:]):\n result = ops[op](result, val)\n return result", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
354
|
+
{"id": "code-verifier/353", "task_id": "HumanEval/49", "entry_point": "modp", "prompt": "\n\ndef modp(n: int, p: int):\n \"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\n", "solution": "def modp(n: int, p: int):\n if n == 0:\n return 1 % p\n result = 1\n for _ in range(n):\n result = (result * 2) % p\n return result", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
355
|
+
{"id": "code-verifier/354", "task_id": "HumanEval/91", "entry_point": "is_bored", "prompt": "\ndef is_bored(S):\n \"\"\"\n You'll be given a string of words, and your task is to count the number\n of boredoms. A boredom is a sentence that starts with the word \"I\".\n Sentences are delimited by '.', '?' or '!'.\n \n For example:\n >>> is_bored(\"Hello world\")\n 0\n >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n 1\n \"\"\"\n", "solution": "def is_bored(S):\n import re\n sentences = re.split(r'[.!?]', S)\n count = 0\n for s in sentences:\n s = s.strip()\n if s == \"I\" or s.startswith(\"I \"):\n count += 1\n return count", "passes": false, "model": "qwen3.8-27b-mtp-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
356
|
+
{"id": "code-verifier/355", "task_id": "HumanEval/62", "entry_point": "derivative", "prompt": "\n\ndef derivative(xs: list):\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\n", "solution": "def derivative(xs: list):\n if len(xs) <= 1:\n return []\n \n n = len(xs)\n result = []\n \n # The derivative of xs[i] * x^i is i * xs[i] * x^(i-1)\n # The new coefficient for x^(i-1) is i * xs[i]\n # The new list will have length n-1, corresponding to powers x^0 to x^(n-2)\n \n for i in range(1, n):\n # The coefficient of x^(i-1) in the derivative is i * xs[i]\n result.append(i * xs[i])\n \n return result", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
357
|
+
{"id": "code-verifier/356", "task_id": "HumanEval/124", "entry_point": "valid_date", "prompt": "\ndef valid_date(date):\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n for example: \n valid_date('03-11-2000') => True\n\n valid_date('15-01-2012') => False\n\n valid_date('04-0-2040') => False\n\n valid_date('06-04-2020') => True\n\n valid_date('06/04/2020') => False\n \"\"\"\n", "solution": "import re\n\ndef valid_date(date):\n if not date:\n return False\n \n if not re.match(r\"^\\d{2}-\\d{2}-\\d{4}$\", date):\n return False\n \n try:\n month_str, day_str, year_str = date.split('-')\n month = int(month_str)\n day = int(day_str)\n year = int(year_str)\n except ValueError:\n return False\n\n if not (1 <= month <= 12):\n return False\n\n if not (1 <= day):\n return False\n\n days_in_month = {\n 1: 31, 2: 29, 3: 31, 4: 30, 5: 31, 6: 30,\n 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31\n }\n\n if month in [1, 3, 5, 7, 8, 10, 12]:\n if not (1 <= day <= 31):\n return False\n elif month in [4, 6, 9, 11]:\n if not (1 <= day <= 30):\n return False\n elif month == 2:\n # Leap year check for February\n is_leap = (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0)\n max_days = 29 if is_leap else 28\n if not (1 <= day <= max_days):\n return False\n else:\n # Should be caught by month check, but for safety\n return False\n\n return True", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
358
|
+
{"id": "code-verifier/357", "task_id": "HumanEval/74", "entry_point": "total_match", "prompt": "\ndef total_match(lst1, lst2):\n '''\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n total_match([], []) ➞ []\n total_match(['hi', 'admin'], ['hI', 'Hi']) ➞ ['hI', 'Hi']\n total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) ➞ ['hi', 'admin']\n total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) ➞ ['hI', 'hi', 'hi']\n total_match(['4'], ['1', '2', '3', '4', '5']) ➞ ['4']\n '''\n", "solution": "def total_match(lst1, lst2):\n sum1 = sum(len(s) for s in lst1)\n sum2 = sum(len(s) for s in lst2)\n if sum1 < sum2:\n return lst1\n elif sum2 < sum1:\n return lst2\n else:\n return lst1", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
359
|
+
{"id": "code-verifier/358", "task_id": "HumanEval/127", "entry_point": "intersection", "prompt": "\ndef intersection(interval1, interval2):\n \"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n intersection((1, 2), (2, 3)) ==> \"NO\"\n intersection((-1, 1), (0, 4)) ==> \"NO\"\n intersection((-3, -1), (-5, 5)) ==> \"YES\"\n \"\"\"\n", "solution": "def intersection(interval1, interval2):\n start1, end1 = interval1\n start2, end2 = interval2\n\n # Calculate the intersection interval\n overlap_start = max(start1, start2)\n overlap_end = min(end1, end2)\n\n # Check if there is an intersection\n if overlap_start > overlap_end:\n return \"NO\"\n\n # Calculate the length of the intersection\n length = overlap_end - overlap_start + 1\n\n # Check if the length is a prime number\n if length <= 1:\n return \"NO\"\n \n for i in range(2, int(length**0.5) + 1):\n if length % i == 0:\n return \"NO\"\n \n return \"YES\"", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
360
|
+
{"id": "code-verifier/359", "task_id": "HumanEval/105", "entry_point": "by_length", "prompt": "\ndef by_length(arr):\n \"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n arr = [2, 1, 1, 4, 5, 8, 2, 3] \n -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the array is empty, return an empty array:\n arr = []\n return []\n \n If the array has any strange number ignore it:\n arr = [1, -1 , 55] \n -> sort arr -> [-1, 1, 55]\n -> reverse arr -> [55, 1, -1]\n return = ['One']\n \"\"\"\n", "solution": "def by_length(arr):\n # Filter and sort only valid integers between 1 and 9 inclusive\n valid = [x for x in arr if 1 <= x <= 9]\n # Sort and reverse as required\n sorted_rev = sorted(valid, reverse=True)\n # Map each digit to its name\n name_map = {\n 1: \"One\", 2: \"Two\", 3: \"Three\", 4: \"Four\",\n 5: \"Five\", 6: \"Six\", 7: \"Seven\", 8: \"Eight\", 9: \"Nine\"\n }\n return [name_map[num] for num in sorted_rev]", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
361
|
+
{"id": "code-verifier/360", "task_id": "HumanEval/125", "entry_point": "split_words", "prompt": "\ndef split_words(txt):\n '''\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n split_words(\"Hello world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"Hello,world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"abcdef\") == 3 \n '''\n", "solution": "def split_words(txt):\n words = txt.split()\n if words:\n return words\n # No whitespace, try splitting on commas\n if ',' in txt:\n parts = txt.split(',')\n # Filter out empty strings and strip whitespace\n words = [part.strip() for part in parts if part.strip()]\n if words:\n return words\n # No whitespace or commas: count odd-order lowercase letters\n count = 0\n for ch in txt:\n if 'a' <= ch <= 'z':\n if (ord(ch) - ord('a')) % 2 == 1:\n count += 1\n return count", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
362
|
+
{"id": "code-verifier/361", "task_id": "HumanEval/18", "entry_point": "how_many_times", "prompt": "\n\ndef how_many_times(string: str, substring: str) -> int:\n \"\"\" Find how many times a given substring can be found in the original string. Count overlaping cases.\n >>> how_many_times('', 'a')\n 0\n >>> how_many_times('aaa', 'a')\n 3\n >>> how_many_times('aaaa', 'aa')\n 3\n \"\"\"\n", "solution": "\n\ndef how_many_times(string: str, substring: str) -> int:\n \"\"\" Find how many times a given substring can be found in the original string. Count overlaping cases.\n >>> how_many_times('', 'a')\n 0\n >>> how_many_times('aaa', 'a')\n 3\n >>> how_many_times('aaaa', 'aa')\n 3\n \"\"\"\n count = 0\n for i in range(len(string) - len(substring) + 1):\n if string[i:i+len(substring)] == substring:\n count += 1\n return count", "passes": true, "model": "qwen3.8-35b-a3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
363
|
+
{"id": "code-verifier/362", "task_id": "HumanEval/93", "entry_point": "encode", "prompt": "\ndef encode(message):\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \"\"\"\n", "solution": "def encode(message):\n result = []\n for char in message:\n if char.islower():\n new_char = chr(ord(char) - 32)\n elif char.isupper():\n new_char = chr(ord(char) + 32)\n else:\n new_char = char\n \n if new_char.lower() in 'aeiou':\n shifted = ord(new_char) + 2\n if shifted > ord('z'):\n shifted -= 26\n elif shifted < ord('a'):\n shifted += 26\n result.append(chr(shifted))\n else:\n result.append(new_char)\n return ''.join(result)", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
364
|
+
{"id": "code-verifier/363", "task_id": "HumanEval/101", "entry_point": "words_string", "prompt": "\ndef words_string(s):\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n", "solution": "\ndef words_string(s):\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n return [word for word in s.replace(',', ' ').split()]", "passes": true, "model": "minicpm5-2b-q8-bench", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
365
|
+
{"id": "code-verifier/364", "task_id": "HumanEval/105", "entry_point": "by_length", "prompt": "\ndef by_length(arr):\n \"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n arr = [2, 1, 1, 4, 5, 8, 2, 3] \n -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the array is empty, return an empty array:\n arr = []\n return []\n \n If the array has any strange number ignore it:\n arr = [1, -1 , 55] \n -> sort arr -> [-1, 1, 55]\n -> reverse arr -> [55, 1, -1]\n return = ['One']\n \"\"\"\n", "solution": "\ndef by_length(arr):\n \"\"\"\n Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n reverse the resulting array, and then replace each digit by its corresponding name from\n \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n For example:\n arr = [2, 1, 1, 4, 5, 8, 2, 3] \n -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8] \n -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n \n If the array is empty, return an empty array:\n arr = []\n return []\n \n If the array has any strange number ignore it:\n arr = [1, -1 , 55] \n -> sort arr -> [-1, 1, 55]\n -> reverse arr -> [55, 1, -1]\n return = ['One']\n \"\"\"\n if not arr:\n return []\n\n filtered_arr = [x for x in arr if 1 <= x <= 9]\n\n sorted_arr = sorted(filtered_arr)\n reversed_arr = sorted_arr[::-1]\n\n digit_names = [\"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\"]\n\n result = [digit_names[digit] for digit in reversed_arr]\n return result", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
366
|
+
{"id": "code-verifier/365", "task_id": "HumanEval/9", "entry_point": "rolling_max", "prompt": "from typing import List, Tuple\n\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\n", "solution": "from typing import List, Tuple\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n result = []\n current_max = float('-inf')\n for num in numbers:\n if num > current_max:\n current_max = num\n result.append(current_max)\n return result", "passes": true, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
367
|
+
{"id": "code-verifier/366", "task_id": "HumanEval/120", "entry_point": "maximum", "prompt": "\ndef maximum(arr, k):\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n Input: arr = [-3, -4, 5], k = 3\n Output: [-4, -3, 5]\n\n Example 2:\n\n Input: arr = [4, -4, 4], k = 2\n Output: [4, 4]\n\n Example 3:\n\n Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n Output: [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n", "solution": "def maximum(arr, k):\n if k == 0:\n return []\n sorted_arr = sorted(arr, reverse=True)\n return sorted_arr[:k]", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
368
|
+
{"id": "code-verifier/367", "task_id": "HumanEval/22", "entry_point": "filter_integers", "prompt": "from typing import List, Any\n\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', {}, []])\n [1, 2, 3]\n \"\"\"\n", "solution": "from typing import List, Any\n\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', {}, []])\n [1, 2, 3]\n \"\"\"\n return [value for value in values if isinstance(value, int) and not isinstance(value, bool)]", "passes": true, "model": "qwen3.8-27b-mtp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
369
|
+
{"id": "code-verifier/368", "task_id": "HumanEval/140", "entry_point": "fix_spaces", "prompt": "\ndef fix_spaces(text):\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \"\"\"\n", "solution": "def fix_spaces(text):\n import re\n return re.sub(r'_+', '_', text.replace(' ', '_'))", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
370
|
+
{"id": "code-verifier/369", "task_id": "HumanEval/100", "entry_point": "make_a_pile", "prompt": "\ndef make_a_pile(n):\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n", "solution": "\ndef make_a_pile(n):\n \"\"\"\n Given a positive integer n, you have to make a pile of n levels of stones.\n The first level has n stones.\n The number of stones in the next level is:\n - the next odd number if n is odd.\n - the next even number if n is even.\n Return the number of stones in each level in a list, where element at index\n i represents the number of stones in the level (i+1).\n\n Examples:\n >>> make_a_pile(3)\n [3, 5, 7]\n \"\"\"\n result = []\n parity = 'odd' if n % 2 else 'even'\n level = n\n while len(result) < n:\n result.append(level)\n level += 2\n return result", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
371
|
+
{"id": "code-verifier/370", "task_id": "HumanEval/76", "entry_point": "is_simple_power", "prompt": "\ndef is_simple_power(x, n):\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \"\"\"\n", "solution": "def is_simple_power(x, n):\n if n == 0:\n return x == 0 or x == 1\n if n == 1:\n return x == 1\n if n == -1:\n return x == 1 or x == -1\n power = 1\n while power < x:\n power *= n\n return power == x", "passes": false, "model": "qwen3.8-27b-mtp-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
372
|
+
{"id": "code-verifier/371", "task_id": "HumanEval/133", "entry_point": "sum_squares", "prompt": "\n\ndef sum_squares(lst):\n \"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n For lst = [1,2,3] the output should be 14\n For lst = [1,4,9] the output should be 98\n For lst = [1,3,5,7] the output should be 84\n For lst = [1.4,4.2,0] the output should be 29\n For lst = [-2.4,1,1] the output should be 6\n \n\n \"\"\"\n", "solution": "def sum_squares(lst):\n import math\n total = 0\n for num in lst:\n total += (math.ceil(num)) ** 2\n return total", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
373
|
+
{"id": "code-verifier/372", "task_id": "HumanEval/46", "entry_point": "fib4", "prompt": "\n\ndef fib4(n: int):\n \"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5)\n 4\n >>> fib4(6)\n 8\n >>> fib4(7)\n 14\n \"\"\"\n", "solution": "\n\ndef fib4(n: int):\n \"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fib4(0) -> 0\n fib4(1) -> 0\n fib4(2) -> 2\n fib4(3) -> 0\n fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.\n >>> fib4(5)\n 4\n >>> fib4(6)\n 8\n >>> fib4(7)\n 14\n \"\"\"\n if n == 0:\n return 0\n if n == 1:\n return 0\n if n == 2:\n return 2\n if n == 3:\n return 0\n\n a = 0\n b = 0\n c = 2\n d = 0\n for _ in range(4, n + 1):\n next_fib = a + b + c + d\n a = b\n b = c\n c = d\n d = next_fib\n return d", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
374
|
+
{"id": "code-verifier/373", "task_id": "HumanEval/63", "entry_point": "fibfib", "prompt": "\n\ndef fibfib(n: int):\n \"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:\n fibfib(0) == 0\n fibfib(1) == 0\n fibfib(2) == 1\n fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n >>> fibfib(1)\n 0\n >>> fibfib(5)\n 4\n >>> fibfib(8)\n 24\n \"\"\"\n", "solution": "def fibfib(n: int):\n if n == 0 or n == 1:\n return 0\n if n == 2:\n return 1\n a, b, c = 0, 0, 1\n for _ in range(3, n + 1):\n a, b, c = b, c, a + b + c\n return c", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
375
|
+
{"id": "code-verifier/374", "task_id": "HumanEval/102", "entry_point": "choose_num", "prompt": "\ndef choose_num(x, y):\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n", "solution": "\ndef choose_num(x, y):\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n if x > y:\n return -1\n\n start = x\n if start % 2 != 0:\n start += 1\n\n if start > y:\n return -1\n\n return start", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
376
|
+
{"id": "code-verifier/375", "task_id": "HumanEval/65", "entry_point": "circular_shift", "prompt": "\ndef circular_shift(x, shift):\n \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n \"21\"\n >>> circular_shift(12, 2)\n \"12\"\n \"\"\"\n", "solution": "def circular_shift(x, shift):\n s = str(x)\n n = len(s)\n if shift > n:\n return s[::-1]\n else:\n shift %= n\n return s[-shift:] + s[:-shift]", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
377
|
+
{"id": "code-verifier/376", "task_id": "HumanEval/27", "entry_point": "flip_case", "prompt": "\n\ndef flip_case(string: str) -> str:\n \"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case('Hello')\n 'hELLO'\n \"\"\"\n", "solution": "\n\ndef flip_case(string: str) -> str:\n \"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n >>> flip_case('Hello')\n 'hELLO'\n \"\"\"\n result = []\n for char in string:\n if 'a' <= char <= 'z':\n result.append(char.upper())\n elif 'A' <= char <= 'Z':\n result.append(char.lower())\n else:\n result.append(char)\n return \"\".join(result)", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
378
|
+
{"id": "code-verifier/377", "task_id": "HumanEval/83", "entry_point": "starts_one_ends", "prompt": "\ndef starts_one_ends(n):\n \"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"\n", "solution": "def starts_one_ends(n):\n return 10**(n-1) + 8 * (10 ** (n-2)) if n > 1 else 1", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
379
|
+
{"id": "code-verifier/378", "task_id": "HumanEval/125", "entry_point": "split_words", "prompt": "\ndef split_words(txt):\n '''\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n split_words(\"Hello world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"Hello,world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"abcdef\") == 3 \n '''\n", "solution": "def split_words(txt):\n if any(isspace(c) for c in txt):\n return txt.split()\n elif ',' in txt:\n return txt.split(',')\n else:\n count = 0\n for ch in txt:\n if 'a' <= ch <= 'z':\n idx = ord(ch) - ord('a')\n if idx % 2 == 1:\n count += 1\n return count", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
380
|
+
{"id": "code-verifier/379", "task_id": "HumanEval/121", "entry_point": "solution", "prompt": "\ndef solution(lst):\n \"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n solution([5, 8, 7, 1]) ==> 12\n solution([3, 3, 3, 3, 3]) ==> 9\n solution([30, 13, 24, 321]) ==>0\n \"\"\"\n", "solution": "def solution(lst):\n return sum(x for i, x in enumerate(lst) if i % 2 == 0 and x % 2 != 0)", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
381
|
+
{"id": "code-verifier/380", "task_id": "HumanEval/39", "entry_point": "prime_fib", "prompt": "\n\ndef prime_fib(n: int):\n \"\"\"\n prime_fib returns n-th number that is a Fibonacci number and it's also prime.\n >>> prime_fib(1)\n 2\n >>> prime_fib(2)\n 3\n >>> prime_fib(3)\n 5\n >>> prime_fib(4)\n 13\n >>> prime_fib(5)\n 89\n \"\"\"\n", "solution": "def prime_fib(n: int):\n if n <= 0:\n raise ValueError(\"n must be a positive integer\")\n\n def is_prime(num):\n if num < 2:\n return False\n for i in range(2, int(num**0.5) + 1):\n if num % i == 0:\n return False\n return True\n\n fib_numbers = []\n a, b = 0, 1\n while a <= 10**18: # A practical limit for Fibonacci numbers to avoid overflow issues if n is large, though the problem constraints are not specified.\n if a > 0:\n fib_numbers.append(a)\n a, b = b, a + b\n\n prime_fib_list = []\n for fib in fib_numbers:\n if is_prime(fib):\n prime_fib_list.append(fib)\n\n if n > len(prime_fib_list):\n raise IndexError(\"n is too large, no n-th prime Fibonacci number exists within the calculated range.\")\n\n return prime_fib_list[n - 1]", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
382
|
+
{"id": "code-verifier/381", "task_id": "HumanEval/119", "entry_point": "match_parens", "prompt": "\ndef match_parens(lst):\n '''\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n match_parens(['()(', ')']) == 'Yes'\n match_parens([')', ')']) == 'No'\n '''\n", "solution": "def match_parens(lst):\n a, b = lst\n def check(s):\n bal = 0\n for ch in s:\n if ch == '(':\n bal += 1\n elif ch == ')':\n bal -= 1\n if bal < 0:\n return False\n return bal == 0\n if check(a + b) or check(b + a):\n return 'Yes'\n else:\n return 'No'", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
383
|
+
{"id": "code-verifier/382", "task_id": "HumanEval/113", "entry_point": "odd_count", "prompt": "\ndef odd_count(lst):\n \"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count(['1234567'])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count(['3',\"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \"\"\"\n", "solution": "def odd_count(lst):\n result = []\n for s in lst:\n odd_digits = sum(1 for ch in s if int(ch) % 2 == 1)\n phrase = f\"the number of odd elements {odd_digits}n the str{s} of the input.\"\n result.append(phrase)\n return result", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
384
|
+
{"id": "code-verifier/383", "task_id": "HumanEval/75", "entry_point": "is_multiply_prime", "prompt": "\ndef is_multiply_prime(a):\n \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n and false otherwise.\n Knowing that (a) is less then 100. \n Example:\n is_multiply_prime(30) == True\n 30 = 2 * 3 * 5\n \"\"\"\n", "solution": "def is_multiply_prime(a):\n def get_primes(limit):\n sieve = [True] * (limit + 1)\n sieve[0] = sieve[1] = False\n for i in range(2, int(limit**0.5) + 1):\n if sieve[i]:\n for j in range(i*i, limit+1, i):\n sieve[j] = False\n return [i for i, is_prime in enumerate(sieve) if is_prime]\n \n primes = get_primes(97)\n n = len(primes)\n for i in range(n):\n p1 = primes[i]\n if p1 * p1 * p1 > a:\n break\n for j in range(i, n):\n p2 = primes[j]\n if p1 * p2 * p2 > a:\n break\n for k in range(j, n):\n p3 = primes[k]\n prod = p1 * p2 * p3\n if prod == a:\n return True\n return False", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
385
|
+
{"id": "code-verifier/384", "task_id": "HumanEval/11", "entry_point": "string_xor", "prompt": "from typing import List\n\n\ndef string_xor(a: str, b: str) -> str:\n \"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor('010', '110')\n '100'\n \"\"\"\n", "solution": "from typing import List\n\n\ndef string_xor(a: str, b: str) -> str:\n \"\"\" Input are two strings a and b consisting only of 1s and 0s.\n Perform binary XOR on these inputs and return result also as a string.\n >>> string_xor('010', '110')\n '100'\n \"\"\"\n return ''.join('1' if x == y else '0' for x, y in zip(a, b))", "passes": false, "model": "ornith-35b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
386
|
+
{"id": "code-verifier/385", "task_id": "HumanEval/9", "entry_point": "rolling_max", "prompt": "from typing import List, Tuple\n\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\n", "solution": "from typing import List, Tuple\n\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\n if not numbers:\n return []\n\n result = []\n current_max = numbers[0]\n result.append(current_max)\n\n for i in range(1, len(numbers)):\n current_max = max(current_max, numbers[i])\n result.append(current_max)\n\n return result", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
387
|
+
{"id": "code-verifier/386", "task_id": "HumanEval/154", "entry_point": "cycpattern_check", "prompt": "\ndef cycpattern_check(a , b):\n \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n cycpattern_check(\"abcd\",\"abd\") => False\n cycpattern_check(\"hello\",\"ell\") => True\n cycpattern_check(\"whassup\",\"psus\") => False\n cycpattern_check(\"abab\",\"baa\") => True\n cycpattern_check(\"efef\",\"eeff\") => False\n cycpattern_check(\"himenss\",\"simen\") => True\n\n \"\"\"\n", "solution": "def cycpattern_check(a , b):\n n = len(b)\n for i in range(n):\n rotation = b[i:] + b[:i]\n if rotation in a:\n return True\n return False", "passes": false, "model": "minicpm5-2b-q4-bench-rp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
388
|
+
{"id": "code-verifier/387", "task_id": "HumanEval/140", "entry_point": "fix_spaces", "prompt": "\ndef fix_spaces(text):\n \"\"\"\n Given a string text, replace all spaces in it with underscores, \n and if a string has more than 2 consecutive spaces, \n then replace all consecutive spaces with - \n \n fix_spaces(\"Example\") == \"Example\"\n fix_spaces(\"Example 1\") == \"Example_1\"\n fix_spaces(\" Example 2\") == \"_Example_2\"\n fix_spaces(\" Example 3\") == \"_Example-3\"\n \"\"\"\n", "solution": "def fix_spaces(text):\n import re\n def replace(match):\n spaces = match.group()\n if len(spaces) > 2:\n return '-'\n return '_' * len(spaces)\n return re.sub(r' +', replace, text)", "passes": true, "model": "bonsai2-27b-pq2-np4", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
389
|
+
{"id": "code-verifier/388", "task_id": "HumanEval/84", "entry_point": "solve", "prompt": "\ndef solve(N):\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n For N = 1000, the sum of digits will be 1 the output should be \"1\".\n For N = 150, the sum of digits will be 6 the output should be \"110\".\n For N = 147, the sum of digits will be 12 the output should be \"1100\".\n \n Variables:\n @N integer\n Constraints: 0 ≤ N ≤ 10000.\n Output:\n a string of binary number\n \"\"\"\n", "solution": "\ndef solve(N):\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n For N = 1000, the sum of digits will be 1 the output should be \"1\".\n For N = 150, the sum of digits will be 6 the output should be \"110\".\n For N = 147, the sum of digits will be 12 the output should be \"1100\".\n \n Variables:\n @N integer\n Constraints: 0 ≤ N ≤ 10000.\n Output:\n a string of binary number\n \"\"\"\n binary_representation = bin(N)\n return binary_representation", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
390
|
+
{"id": "code-verifier/389", "task_id": "HumanEval/122", "entry_point": "add_elements", "prompt": "\ndef add_elements(arr, k):\n \"\"\"\n Given a non-empty array of integers arr and an integer k, return\n the sum of the elements with at most two digits from the first k elements of arr.\n\n Example:\n\n Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n Output: 24 # sum of 21 + 3\n\n Constraints:\n 1. 1 <= len(arr) <= 100\n 2. 1 <= k <= len(arr)\n \"\"\"\n", "solution": "def add_elements(arr, k):\n return sum(num for num in arr[:k] if abs(num) < 100)", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
391
|
+
{"id": "code-verifier/390", "task_id": "HumanEval/37", "entry_point": "sort_even", "prompt": "\n\ndef sort_even(l: list):\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1, 2, 3])\n [1, 2, 3]\n >>> sort_even([5, 6, 3, 4])\n [3, 6, 5, 4]\n \"\"\"\n", "solution": "def sort_even(l: list):\n evens = sorted([l[i] for i in range(0, len(l), 2)])\n return [evens[i] if i % 2 == 0 else l[i] for i in range(len(l))]", "passes": false, "model": "lfm2.5-8b-a1b-dspark", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
392
|
+
{"id": "code-verifier/391", "task_id": "HumanEval/97", "entry_point": "multiply", "prompt": "\ndef multiply(a, b):\n \"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n multiply(148, 412) should return 16.\n multiply(19, 28) should return 72.\n multiply(2020, 1851) should return 0.\n multiply(14,-15) should return 20.\n \"\"\"\n", "solution": "def multiply(a, b):\n unit_a = abs(a) % 10\n unit_b = abs(b) % 10\n return unit_a * unit_b", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
393
|
+
{"id": "code-verifier/392", "task_id": "HumanEval/115", "entry_point": "max_fill", "prompt": "import math\n\ndef max_fill(grid, capacity):\n \"\"\"\n You are given a rectangular grid of wells. Each row represents a single well,\n and each 1 in a row represents a single unit of water.\n Each well has a corresponding bucket that can be used to extract water from it, \n and all buckets have the same capacity.\n Your task is to use the buckets to empty the wells.\n Output the number of times you need to lower the buckets.\n\n Example 1:\n Input: \n grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n bucket_capacity : 1\n Output: 6\n\n Example 2:\n Input: \n grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n bucket_capacity : 2\n Output: 5\n \n Example 3:\n Input: \n grid : [[0,0,0], [0,0,0]]\n bucket_capacity : 5\n Output: 0\n\n Constraints:\n * all wells have the same length\n * 1 <= grid.length <= 10^2\n * 1 <= grid[:,1].length <= 10^2\n * grid[i][j] -> 0 | 1\n * 1 <= capacity <= 10\n \"\"\"\n", "solution": "import math\n\ndef max_fill(grid, capacity):\n total_water = sum(sum(row) for row in grid)\n if total_water == 0:\n return 0\n return math.ceil(total_water / capacity)", "passes": false, "model": "qwen3.8-27b-mtp-nothink", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
394
|
+
{"id": "code-verifier/393", "task_id": "HumanEval/118", "entry_point": "get_closest_vowel", "prompt": "\ndef get_closest_vowel(word):\n \"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n get_closest_vowel(\"yogurt\") ==> \"u\"\n get_closest_vowel(\"FULL\") ==> \"U\"\n get_closest_vowel(\"quick\") ==> \"\"\n get_closest_vowel(\"ab\") ==> \"\"\n \"\"\"\n", "solution": "def get_closest_vowel(word):\n vowels = \"aeiouAEIOU\"\n n = len(word)\n \n # Iterate from the second to last character backwards\n for i in range(n - 2, 0, -1):\n if word[i] in vowels:\n # Check if the character before (i-1) and after (i+1) are consonants\n is_left_consonant = word[i-1].isalpha() and word[i-1] not in vowels\n is_right_consonant = word[i+1].isalpha() and word[i+1] not in vowels\n \n if is_left_consonant and is_right_consonant:\n return word[i]\n \n return \"\"", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
395
|
+
{"id": "code-verifier/394", "task_id": "HumanEval/9", "entry_point": "rolling_max", "prompt": "from typing import List, Tuple\n\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n in the sequence.\n >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n [1, 2, 3, 3, 3, 4, 4]\n \"\"\"\n", "solution": "from typing import List, Tuple\n\ndef rolling_max(numbers: List[int]) -> List[int]:\n result = []\n current_max = numbers[0]\n for num in numbers:\n if num > current_max:\n current_max = num\n result.append(current_max)\n return result", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
396
|
+
{"id": "code-verifier/395", "task_id": "HumanEval/133", "entry_point": "sum_squares", "prompt": "\n\ndef sum_squares(lst):\n \"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n For lst = [1,2,3] the output should be 14\n For lst = [1,4,9] the output should be 98\n For lst = [1,3,5,7] the output should be 84\n For lst = [1.4,4.2,0] the output should be 29\n For lst = [-2.4,1,1] the output should be 6\n \n\n \"\"\"\n", "solution": "def sum_squares(lst):\n import math\n total = 0\n for x in lst:\n total += math.ceil(x) ** 2\n return total", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
397
|
+
{"id": "code-verifier/396", "task_id": "HumanEval/99", "entry_point": "closest_integer", "prompt": "\ndef closest_integer(value):\n '''\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n '''\n", "solution": "def closest_integer(value):\n from decimal import Decimal, ROUND_HALF_UP\n d = Decimal(value)\n return int(d.to_integral_value(rounding=ROUND_HALF_UP))", "passes": false, "model": "minicpm5-2b-q8-bench-rp120", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
398
|
+
{"id": "code-verifier/397", "task_id": "HumanEval/95", "entry_point": "check_dict_case", "prompt": "\ndef check_dict_case(dict):\n \"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n check_dict_case({\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}) should return False.\n check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n \"\"\"\n", "solution": "def check_dict_case(dict):\n if not dict:\n return False\n first_key = next(iter(dict))\n all_lower = all(isinstance(k, str) and k.islower() for k in dict)\n all_upper = all(isinstance(k, str) and k.isupper() for k in dict)\n return all_lower or all_upper", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
399
|
+
{"id": "code-verifier/398", "task_id": "HumanEval/162", "entry_point": "string_to_md5", "prompt": "\ndef string_to_md5(text):\n \"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n \"\"\"\n", "solution": "def string_to_md5(text):\n if text == '':\n return None\n md5_hash = md5(text.encode()).hexdigest()\n return md5_hash", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
400
|
+
{"id": "code-verifier/399", "task_id": "HumanEval/162", "entry_point": "string_to_md5", "prompt": "\ndef string_to_md5(text):\n \"\"\"\n Given a string 'text', return its md5 hash equivalent string.\n If 'text' is an empty string, return None.\n\n >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n \"\"\"\n", "solution": "import hashlib\n\ndef string_to_md5(text):\n if text == \"\":\n return None\n return hashlib.md5(text.encode('utf-8')).hexdigest()", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
401
|
+
{"id": "code-verifier/400", "task_id": "HumanEval/95", "entry_point": "check_dict_case", "prompt": "\ndef check_dict_case(dict):\n \"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n check_dict_case({\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}) should return False.\n check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n \"\"\"\n", "solution": "def check_dict_case(dict):\n if not dict:\n return False\n for k in dict:\n if not isinstance(k, str):\n return False\n first = next((k for k in dict if any(c.isalpha() for c in k)), None)\n if first is None:\n return False\n lower = first.islower()\n upper = first.isupper()\n for k in dict:\n if isinstance(k, str):\n if (k.islower() != lower) and (k.isupper() != upper):\n return False\n return True", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
402
|
+
{"id": "code-verifier/401", "task_id": "HumanEval/142", "entry_point": "sum_squares", "prompt": "\n\n\ndef sum_squares(lst):\n \"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n For lst = [1,2,3] the output should be 6\n For lst = [] the output should be 0\n For lst = [-1,-5,2,-1,-5] the output should be -126\n \"\"\"\n", "solution": "\n\n\ndef sum_squares(lst):\n \"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n For lst = [1,2,3] the output should be 6\n For lst = [] the output should be 0\n For lst = [-1,-5,2,-1,-5] the output should be -126\n \"\"\"\n result = 0\n for i, num in enumerate(lst):\n if i % 3 == 0:\n result += num ** 2\n elif i % 4 == 0:\n result += num ** 3\n else:\n result += num\n return result", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
403
|
+
{"id": "code-verifier/402", "task_id": "HumanEval/144", "entry_point": "simplify", "prompt": "\ndef simplify(x, n):\n \"\"\"Your task is to implement a function that will simplify the expression\n x * n. The function returns True if x * n evaluates to a whole number and False\n otherwise. Both x and n, are string representation of a fraction, and have the following format,\n <numerator>/<denominator> where both numerator and denominator are positive whole numbers.\n\n You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n simplify(\"1/5\", \"5/1\") = True\n simplify(\"1/6\", \"2/1\") = False\n simplify(\"7/10\", \"10/2\") = False\n \"\"\"\n", "solution": "def simplify(x, n):\n x_num, x_den = map(int, x.split('/'))\n n_num, n_den = map(int, n.split('/'))\n if (x_num * n_den) % (x_den * n_num) == 0:\n return True\n else:\n return False", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
404
|
+
{"id": "code-verifier/403", "task_id": "HumanEval/123", "entry_point": "get_odd_collatz", "prompt": "\ndef get_odd_collatz(n):\n \"\"\"\n Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned list sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n \"\"\"\n", "solution": "\ndef get_odd_collatz(n):\n \"\"\"\n Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n as follows: start with any positive integer n. Then each term is obtained from the \n previous term as follows: if the previous term is even, the next term is one half of \n the previous term. If the previous term is odd, the next term is 3 times the previous\n term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n Note: \n 1. Collatz(1) is [1].\n 2. returned list sorted in increasing order.\n\n For example:\n get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n \"\"\"\n if n <= 0:\n return []\n\n sequence = [n]\n current = n\n while current != 1:\n if current % 2 == 0:\n current = current // 2\n else:\n current = 3 * current + 1\n sequence.append(current)\n\n if sequence[-1] == 1:\n odd_numbers = [x for x in sequence if x % 2 != 0]\n return sorted(odd_numbers)\n else:\n # This case should ideally not happen based on the conjecture, \n # but if the sequence doesn't reach 1, we return the odd numbers found so far.\n odd_numbers = [x for x in sequence if x % 2 != 0]\n return sorted(odd_numbers)", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
405
|
+
{"id": "code-verifier/404", "task_id": "HumanEval/124", "entry_point": "valid_date", "prompt": "\ndef valid_date(date):\n \"\"\"You have to write a function which validates a given date string and\n returns True if the date is valid otherwise False.\n The date is valid if all of the following rules are satisfied:\n 1. The date string is not empty.\n 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n 3. The months should not be less than 1 or higher than 12.\n 4. The date should be in the format: mm-dd-yyyy\n\n for example: \n valid_date('03-11-2000') => True\n\n valid_date('15-01-2012') => False\n\n valid_date('04-0-2040') => False\n\n valid_date('06-04-2020') => True\n\n valid_date('06/04/2020') => False\n \"\"\"\n", "solution": "def valid_date(date):\n if not date:\n return False\n \n parts = date.split('-')\n if len(parts) != 3:\n return False\n \n for part in parts:\n if not part.isdigit():\n return False\n \n month, day, year = map(int, parts)\n \n # Rule 3: The months should not be less than 1 or higher than 12\n if month < 1 or month > 12:\n return False\n \n # Determine the maximum number of days for the given month\n if month in (1, 3, 5, 7, 8, 10, 12):\n max_days = 31\n elif month in (4, 6, 9, 11):\n max_days = 30\n else: # Month is 2 (February)\n # Check for leap year to determine days in February\n if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):\n max_days = 29\n else:\n max_days = 28\n \n # Rule 2: The number of days must be between 1 and the maximum for that month\n if day < 1 or day > max_days:\n return False\n \n return True", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
406
|
+
{"id": "code-verifier/405", "task_id": "HumanEval/55", "entry_point": "fib", "prompt": "\n\ndef fib(n: int):\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n", "solution": "\n\ndef fib(n: int):\n \"\"\"Return n-th Fibonacci number.\n >>> fib(10)\n 55\n >>> fib(1)\n 1\n >>> fib(8)\n 21\n \"\"\"\n if n <= 0:\n return 0\n elif n == 1:\n return 1\n else:\n a, b = 0, 1\n for _ in range(2, n + 1):\n a, b = b, a + b\n return b", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
407
|
+
{"id": "code-verifier/406", "task_id": "HumanEval/143", "entry_point": "words_in_sentence", "prompt": "\ndef words_in_sentence(sentence):\n \"\"\"\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n Input: sentence = \"This is a test\"\n Output: \"is\"\n\n Example 2:\n Input: sentence = \"lets go for swimming\"\n Output: \"go for\"\n\n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \"\"\"\n", "solution": "\ndef words_in_sentence(sentence):\n \"\"\"\n You are given a string representing a sentence,\n the sentence contains some words separated by a space,\n and you have to return a string that contains the words from the original sentence,\n whose lengths are prime numbers,\n the order of the words in the new string should be the same as the original one.\n\n Example 1:\n Input: sentence = \"This is a test\"\n Output: \"is\"\n\n Example 2:\n Input: sentence = \"lets go for swimming\"\n Output: \"go for\"\n\n Constraints:\n * 1 <= len(sentence) <= 100\n * sentence contains only letters\n \"\"\"\n def is_prime(n):\n if n < 2:\n return False\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return False\n return True\n\n words = sentence.split()\n result_words = []\n for word in words:\n if is_prime(len(word)):\n result_words.append(word)\n return \" \".join(result_words)", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
408
|
+
{"id": "code-verifier/407", "task_id": "HumanEval/93", "entry_point": "encode", "prompt": "\ndef encode(message):\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \"\"\"\n", "solution": "\ndef encode(message):\n \"\"\"\n Write a function that takes a message, and encodes in such a \n way that it swaps case of all letters, replaces all vowels in \n the message with the letter that appears 2 places ahead of that \n vowel in the english alphabet. \n Assume only letters. \n \n Examples:\n >>> encode('test')\n 'TGST'\n >>> encode('This is a message')\n 'tHKS KS C MGSSCGG'\n \"\"\"\n vowels = 'aeiouAEIOU'\n result = []\n for char in message:\n if char in vowels:\n char = chr(ord(char) + 2)\n result.append(char.swapcase())\n return ''.join(result)", "passes": true, "model": "qwen3.8-27b-q4-xhigh", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
409
|
+
{"id": "code-verifier/408", "task_id": "HumanEval/49", "entry_point": "modp", "prompt": "\n\ndef modp(n: int, p: int):\n \"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\n", "solution": "def modp(n: int, p: int):\n \"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\n return pow(2, n, p) if p > 1 else 1", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
410
|
+
{"id": "code-verifier/409", "task_id": "HumanEval/65", "entry_point": "circular_shift", "prompt": "\ndef circular_shift(x, shift):\n \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n and return the result as a string.\n If shift > number of digits, return digits reversed.\n >>> circular_shift(12, 1)\n \"21\"\n >>> circular_shift(12, 2)\n \"12\"\n \"\"\"\n", "solution": "def circular_shift(x, shift):\n s = str(x)\n n = len(s)\n if shift > n:\n return s[::-1]\n shift %= n\n return s[-shift:] + s[:-shift]", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
411
|
+
{"id": "code-verifier/410", "task_id": "HumanEval/74", "entry_point": "total_match", "prompt": "\ndef total_match(lst1, lst2):\n '''\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n total_match([], []) ➞ []\n total_match(['hi', 'admin'], ['hI', 'Hi']) ➞ ['hI', 'Hi']\n total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) ➞ ['hi', 'admin']\n total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) ➞ ['hI', 'hi', 'hi']\n total_match(['4'], ['1', '2', '3', '4', '5']) ➞ ['4']\n '''\n", "solution": "\ndef total_match(lst1, lst2):\n '''\n Write a function that accepts two lists of strings and returns the list that has \n total number of chars in the all strings of the list less than the other list.\n\n if the two lists have the same number of chars, return the first list.\n\n Examples\n total_match([], []) ➞ []\n total_match(['hi', 'admin'], ['hI', 'Hi']) ➞ ['hI', 'Hi']\n total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) ➞ ['hi', 'admin']\n total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) ➞ ['hI', 'hi', 'hi']\n total_match(['4'], ['1', '2', '3', '4', '5']) ➞ ['4']\n '''\n if len(lst1) == len(lst2):\n return lst1\n else:\n total1 = sum(len(s) for s in lst1)\n total2 = sum(len(s) for s in lst2)\n if total1 < total2:\n return lst1\n else:\n return lst2", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
412
|
+
{"id": "code-verifier/411", "task_id": "HumanEval/101", "entry_point": "words_string", "prompt": "\ndef words_string(s):\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n", "solution": "\ndef words_string(s):\n \"\"\"\n You will be given a string of words separated by commas or spaces. Your task is\n to split the string into words and return an array of the words.\n \n For example:\n words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n \"\"\"\n words = s.replace(\",\", \" \").split()\n return words", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
413
|
+
{"id": "code-verifier/412", "task_id": "HumanEval/95", "entry_point": "check_dict_case", "prompt": "\ndef check_dict_case(dict):\n \"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n check_dict_case({\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}) should return False.\n check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n \"\"\"\n", "solution": "def check_dict_case(dict):\n if not dict:\n return False\n for k in dict:\n if not isinstance(k, str) or (k.islower() != k.isupper()):\n return False\n return True", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
414
|
+
{"id": "code-verifier/413", "task_id": "HumanEval/85", "entry_point": "add", "prompt": "\ndef add(lst):\n \"\"\"Given a non-empty list of integers lst. add the even elements that are at odd indices..\n\n\n Examples:\n add([4, 2, 6, 7]) ==> 2 \n \"\"\"\n", "solution": "def add(lst):\n total = 0\n for i in range(len(lst)):\n if i % 2 == 1 and lst[i] % 2 == 0:\n total += lst[i]\n return total", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
415
|
+
{"id": "code-verifier/414", "task_id": "HumanEval/95", "entry_point": "check_dict_case", "prompt": "\ndef check_dict_case(dict):\n \"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n check_dict_case({\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}) should return False.\n check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n \"\"\"\n", "solution": "def check_dict_case(dict):\n if not dict:\n return False\n keys = list(dict.keys())\n if not all(isinstance(k, str) for k in keys):\n return False\n all_lower = all(k == k.lower() for k in keys)\n all_upper = all(k == k.upper() for k in keys)\n return all_lower or all_upper", "passes": false, "model": "qwen3.8-27b-mtp-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
416
|
+
{"id": "code-verifier/415", "task_id": "HumanEval/102", "entry_point": "choose_num", "prompt": "\ndef choose_num(x, y):\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n", "solution": "def choose_num(x, y):\n n = y\n while n >= x:\n if n % 2 == 0:\n return n\n n -= 1\n return -1", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
417
|
+
{"id": "code-verifier/416", "task_id": "HumanEval/89", "entry_point": "encrypt", "prompt": "\ndef encrypt(s):\n \"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n encrypt('hi') returns 'lm'\n encrypt('asdfghjkl') returns 'ewhjklnop'\n encrypt('gf') returns 'kj'\n encrypt('et') returns 'ix'\n \"\"\"\n", "solution": "def encrypt(s):\n result = []\n for c in s:\n if 'a' <= c <= 'z':\n shifted = chr((ord(c) - ord('a') + 4) % 26 + ord('a'))\n result.append(shifted)\n return ''.join(result)", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
418
|
+
{"id": "code-verifier/417", "task_id": "HumanEval/84", "entry_point": "solve", "prompt": "\ndef solve(N):\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n For N = 1000, the sum of digits will be 1 the output should be \"1\".\n For N = 150, the sum of digits will be 6 the output should be \"110\".\n For N = 147, the sum of digits will be 12 the output should be \"1100\".\n \n Variables:\n @N integer\n Constraints: 0 ≤ N ≤ 10000.\n Output:\n a string of binary number\n \"\"\"\n", "solution": "def solve(N):\n return bin(sum(int(d) for d in str(N)))[2:]", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
419
|
+
{"id": "code-verifier/418", "task_id": "HumanEval/135", "entry_point": "can_arrange", "prompt": "\ndef can_arrange(arr):\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \"\"\"\n", "solution": "\ndef can_arrange(arr):\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \"\"\"\n for i in range(1, len(arr)):\n if arr[i] < arr[i-1]:\n return i\n return -1", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
420
|
+
{"id": "code-verifier/419", "task_id": "HumanEval/154", "entry_point": "cycpattern_check", "prompt": "\ndef cycpattern_check(a , b):\n \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n cycpattern_check(\"abcd\",\"abd\") => False\n cycpattern_check(\"hello\",\"ell\") => True\n cycpattern_check(\"whassup\",\"psus\") => False\n cycpattern_check(\"abab\",\"baa\") => True\n cycpattern_check(\"efef\",\"eeff\") => False\n cycpattern_check(\"himenss\",\"simen\") => True\n\n \"\"\"\n", "solution": "def cycpattern_check(a , b):\n n = len(b)\n if n == 0:\n return True\n if n > len(a):\n return False\n \n double_b = b + b\n for i in range(n):\n rotation = double_b[i:i+n]\n if rotation in a:\n return True\n return False", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
421
|
+
{"id": "code-verifier/420", "task_id": "HumanEval/66", "entry_point": "digitSum", "prompt": "\ndef digitSum(s):\n \"\"\"Task\n Write a function that takes a string as input and returns the sum of the upper characters only'\n ASCII codes.\n\n Examples:\n digitSum(\"\") => 0\n digitSum(\"abAB\") => 131\n digitSum(\"abcCd\") => 67\n digitSum(\"helloE\") => 69\n digitSum(\"woArBld\") => 131\n digitSum(\"aAaaaXa\") => 153\n \"\"\"\n", "solution": "def digitSum(s):\n return sum(ord(ch) for ch in s if not ('a' <= ch <= 'z'))", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
422
|
+
{"id": "code-verifier/421", "task_id": "HumanEval/129", "entry_point": "minPath", "prompt": "\ndef minPath(grid, k):\n \"\"\"\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples:\n\n Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n Output: [1, 2, 1]\n\n Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n Output: [1]\n \"\"\"\n", "solution": "from collections import deque\n\ndef minPath(grid, k):\n N = len(grid)\n \n # State: (row, col, length)\n # We use BFS to find the lexicographically smallest path.\n # The state in the queue will store the path taken so far.\n \n # Since we are looking for the lexicographically smallest path, \n # a standard BFS might not work directly because the path comparison \n # depends on the entire sequence. However, the problem guarantees a unique \n # answer, suggesting a search that prioritizes smaller values at each step.\n \n # We will use a modified BFS where the queue stores (current_path, current_row, current_col).\n # The comparison logic must be handled carefully.\n \n # A simpler approach given the constraints and the nature of the problem \n # (finding the lexicographically smallest path of fixed length k) is to \n # use Dijkstra's algorithm or a priority queue if we treat the path \n # lexicographically as the cost.\n \n # State in PQ: (path_tuple, r, c)\n # path_tuple is used for comparison.\n \n # Initialize PQ with all possible starting cells (path of length 1)\n pq = []\n for r in range(N):\n for c in range(N):\n start_val = grid[r][c]\n # Path is represented as a tuple of values\n start_path = (start_val,)\n # Priority is based on the path tuple itself (lexicographical comparison)\n # We use (path_tuple, r, c) for the heap, where path_tuple dictates priority.\n import heapq\n heapq.heappush(pq, (start_path, r, c))\n\n # Visited set to prevent cycles in the path construction, but since path length k \n # is fixed and we allow revisiting cells, we need a different visited structure.\n # Since the path length is fixed, we only need to track the best path found \n # to reach a certain state (r, c, length).\n \n # visited[r][c][length] stores the lexicographically smallest path found so far \n # ending at (r, c) with length 'length'.\n # Since k is small (implied by N*N), this might be feasible.\n # However, the path itself is the state, making standard DP/visited tricky.\n \n # Let's rely on the PQ to explore paths in lexicographical order.\n \n # To avoid redundant exploration of paths that are lexicographically larger \n # than one already found for the same (r, c, length), we need a way to prune.\n # If we reach (r, c) with length L via path P1, and later reach it with P2, \n # if P2 > P1 lexicographically, we prune P2.\n \n # visited[r][c][length] = smallest path found so far.\n # Since paths are tuples, comparison works.\n \n # Initialize visited structure. Max length is k.\n # visited[r][c] will store a dictionary mapping length to the best path found.\n visited = [[{} for _ in range(N)] for _ in range(N)]\n\n while pq:\n path_tuple, r, c = heapq.heappop(pq)\n current_len = len(path_tuple)\n current_path = list(path_tuple)\n\n if current_len == k:\n return current_path\n\n # Pruning: If we have already found a path to (r, c) of length current_len \n # that is lexicographically smaller than the current path_tuple, skip.\n # This check is implicitly handled by the PQ if we only push better paths, \n # but since we might push suboptimal paths initially, we check:\n if current_len in visited[r][c] and path_tuple >= visited[r][c][current_len]:\n continue\n \n # Update visited\n if current_len not in visited[r][c] or path_tuple < visited[r][c][current_len]:\n visited[r][c][current_len] = path_tuple\n\n # Explore neighbors\n for dr, dc in [(0, 1), (0, -1), (1, 0), (-1, 0)]:\n nr, nc = r + dr, c + dc\n\n if 0 <= nr < N and 0 <= nc < N:\n next_val = grid[nr][nc]\n new_path_tuple = path_tuple + (next_val,)\n new_len = current_len + 1\n\n if new_len <= k:\n # Check if this new path is better than what's recorded for (nr, nc, new_len)\n is_better = True\n if new_len in visited[nr][nc] and new_path_tuple >= visited[nr][nc][new_len]:\n is_better = False\n \n if is_better:\n heapq.heappush(pq, (new_path_tuple, nr, nc))\n\n # Should be unreachable given the problem guarantees\n return []", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
423
|
+
{"id": "code-verifier/422", "task_id": "HumanEval/77", "entry_point": "iscube", "prompt": "\ndef iscube(a):\n '''\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n iscube(1) ==> True\n iscube(2) ==> False\n iscube(-1) ==> True\n iscube(64) ==> True\n iscube(0) ==> True\n iscube(180) ==> False\n '''\n", "solution": "def iscube(a):\n if a < 0:\n root = int(-a ** (1/3))\n else:\n root = int(a ** (1/3))\n return root * root * root == abs(a)", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
424
|
+
{"id": "code-verifier/423", "task_id": "HumanEval/113", "entry_point": "odd_count", "prompt": "\ndef odd_count(lst):\n \"\"\"Given a list of strings, where each string consists of only digits, return a list.\n Each element i of the output should be \"the number of odd elements in the\n string i of the input.\" where all the i's should be replaced by the number\n of odd digits in the i'th string of the input.\n\n >>> odd_count(['1234567'])\n [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n >>> odd_count(['3',\"11111111\"])\n [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n \"\"\"\n", "solution": "def odd_count(lst):\n result = []\n for s in lst:\n odd_digits = sum(1 for ch in s if int(ch) % 2 == 1)\n # Build the output string as described\n out = f\"the number of odd elements {odd_digits}n the str{odd_digits}ng {odd_digits} of the {odd_digits}nput.\"\n result.append(out)\n return result", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
425
|
+
{"id": "code-verifier/424", "task_id": "HumanEval/133", "entry_point": "sum_squares", "prompt": "\n\ndef sum_squares(lst):\n \"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n For lst = [1,2,3] the output should be 14\n For lst = [1,4,9] the output should be 98\n For lst = [1,3,5,7] the output should be 84\n For lst = [1.4,4.2,0] the output should be 29\n For lst = [-2.4,1,1] the output should be 6\n \n\n \"\"\"\n", "solution": "\n\ndef sum_squares(lst):\n \"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n For lst = [1,2,3] the output should be 14\n For lst = [1,4,9] the output should be 98\n For lst = [1,3,5,7] the output should be 84\n For lst = [1.4,4.2,0] the output should be 29\n For lst = [-2.4,1,1] the output should be 6\n \n\n \"\"\"\n total_sum = 0\n for x in lst:\n rounded_x = int(x + 0.9999999999999999)\n total_sum += rounded_x ** 2\n return total_sum", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
426
|
+
{"id": "code-verifier/425", "task_id": "HumanEval/135", "entry_point": "can_arrange", "prompt": "\ndef can_arrange(arr):\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \"\"\"\n", "solution": "def can_arrange(arr):\n \"\"\"Create a function which returns the largest index of an element which is not greater than or equal to the element immediately preceding it. If no such element exists then return -1. The given array will not contain duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \"\"\"\n max_idx = -1\n for i in range(1, len(arr)):\n if arr[i] < arr[i-1]:\n max_idx = i\n return max_idx", "passes": true, "model": "minicpm5-2b-q4-bench-rp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
427
|
+
{"id": "code-verifier/426", "task_id": "HumanEval/134", "entry_point": "check_if_last_char_is_a_letter", "prompt": "\ndef check_if_last_char_is_a_letter(txt):\n '''\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") ➞ False\n check_if_last_char_is_a_letter(\"apple pi e\") ➞ True\n check_if_last_char_is_a_letter(\"apple pi e \") ➞ False\n check_if_last_char_is_a_letter(\"\") ➞ False \n '''\n", "solution": "def check_if_last_char_is_a_letter(txt):\n words = txt.split()\n if not words:\n return False\n last_word = words[-1]\n return last_word.isalpha() and len(last_word) == 1 and txt.endswith(last_word)", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
428
|
+
{"id": "code-verifier/427", "task_id": "HumanEval/99", "entry_point": "closest_integer", "prompt": "\ndef closest_integer(value):\n '''\n Create a function that takes a value (string) representing a number\n and returns the closest integer to it. If the number is equidistant\n from two integers, round it away from zero.\n\n Examples\n >>> closest_integer(\"10\")\n 10\n >>> closest_integer(\"15.3\")\n 15\n\n Note:\n Rounding away from zero means that if the given number is equidistant\n from two integers, the one you should return is the one that is the\n farthest from zero. For example closest_integer(\"14.5\") should\n return 15 and closest_integer(\"-14.5\") should return -15.\n '''\n", "solution": "def closest_integer(value):\n num = float(value)\n # Determine the integer part and the fractional part\n integer_part = int(num)\n fractional = abs(num - integer_part)\n # If the fractional part is exactly 0.5, we are equidistant\n if fractional == 0.5:\n # Round away from zero: for positive, round up; for negative, round down (more negative)\n if num >= 0:\n return integer_part + 1\n else:\n return integer_part - 1\n # Otherwise, round to nearest integer using standard rounding (away from zero for .5 cases already handled)\n # Use round with custom behavior: Python's round uses bankers rounding, so we implement manually\n if num >= 0:\n return int(num + 0.5)\n else:\n return int(num - 0.5)", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
429
|
+
{"id": "code-verifier/428", "task_id": "HumanEval/8", "entry_point": "sum_product", "prompt": "from typing import List, Tuple\n\n\ndef sum_product(numbers: List[int]) -> Tuple[int, int]:\n \"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n (0, 1)\n >>> sum_product([1, 2, 3, 4])\n (10, 24)\n \"\"\"\n", "solution": "from typing import List, Tuple\n\n\ndef sum_product(numbers: List[int]) -> Tuple[int, int]:\n \"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n Empty sum should be equal to 0 and empty product should be equal to 1.\n >>> sum_product([])\n (0, 1)\n >>> sum_product([1, 2, 3, 4])\n (10, 24)\n \"\"\"\n if not numbers:\n return (0, 1)\n return (sum(numbers), eval('*'.join(map(str, numbers))))", "passes": false, "model": "qwen3.8-35b-a3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
430
|
+
{"id": "code-verifier/429", "task_id": "HumanEval/62", "entry_point": "derivative", "prompt": "\n\ndef derivative(xs: list):\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\n", "solution": "def derivative(xs: list):\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\n return [xs[i+1] * (i+1) for i in range(len(xs)-1)]", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
431
|
+
{"id": "code-verifier/430", "task_id": "HumanEval/139", "entry_point": "special_factorial", "prompt": "\ndef special_factorial(n):\n \"\"\"The Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n >>> special_factorial(4)\n 288\n\n The function will receive an integer as input and should return the special\n factorial of this integer.\n \"\"\"\n", "solution": "def special_factorial(n):\n \"\"\"The Brazilian factorial is defined as:\n brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n where n > 0\n\n For example:\n >>> special_factorial(4)\n 288\n\n The function will receive an integer as input and should return the special\n factorial of this integer.\n \"\"\"\n result = 1\n factorial = 1\n for i in range(n, 0, -1):\n factorial *= i\n result *= factorial\n return result", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
432
|
+
{"id": "code-verifier/431", "task_id": "HumanEval/76", "entry_point": "is_simple_power", "prompt": "\ndef is_simple_power(x, n):\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \"\"\"\n", "solution": "\ndef is_simple_power(x, n):\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \"\"\"\n if n == 0:\n return x == 0 or x == 1\n if x == 0:\n return False\n if n == 1:\n return x == 1\n if n == -1:\n return abs(x) == 1\n if x == 1:\n return True\n if x < 0 and n > 0:\n return False\n a = abs(x)\n b = abs(n)\n if b == 1:\n return a == 1\n count = 0\n temp = a\n while temp > 1:\n if temp % b != 0:\n return False\n temp //= b\n count += 1\n if n > 0:\n return True\n else:\n if x > 0:\n return count % 2 == 0\n else:\n return count % 2 == 1", "passes": true, "model": "muse-glimmer-30b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
433
|
+
{"id": "code-verifier/432", "task_id": "HumanEval/134", "entry_point": "check_if_last_char_is_a_letter", "prompt": "\ndef check_if_last_char_is_a_letter(txt):\n '''\n Create a function that returns True if the last character\n of a given string is an alphabetical character and is not\n a part of a word, and False otherwise.\n Note: \"word\" is a group of characters separated by space.\n\n Examples:\n check_if_last_char_is_a_letter(\"apple pie\") ➞ False\n check_if_last_char_is_a_letter(\"apple pi e\") ➞ True\n check_if_last_char_is_a_letter(\"apple pi e \") ➞ False\n check_if_last_char_is_a_letter(\"\") ➞ False \n '''\n", "solution": "def check_if_last_char_is_a_letter(txt):\n if not txt:\n return False\n return txt[-1].isalpha() and (len(txt) == 1 or txt[-2].isspace())", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
434
|
+
{"id": "code-verifier/433", "task_id": "HumanEval/125", "entry_point": "split_words", "prompt": "\ndef split_words(txt):\n '''\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n split_words(\"Hello world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"Hello,world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"abcdef\") == 3 \n '''\n", "solution": "def split_words(txt):\n if any(c.isspace() for c in txt):\n return txt.split()\n if ',' in txt:\n return txt.split(',')\n count = 0\n for c in txt:\n if c.islower() and (ord(c) - ord('a')) % 2 == 1:\n count += 1\n return count", "passes": true, "model": "qwen3.8-27b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
435
|
+
{"id": "code-verifier/434", "task_id": "HumanEval/89", "entry_point": "encrypt", "prompt": "\ndef encrypt(s):\n \"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n encrypt('hi') returns 'lm'\n encrypt('asdfghjkl') returns 'ewhjklnop'\n encrypt('gf') returns 'kj'\n encrypt('et') returns 'ix'\n \"\"\"\n", "solution": "def encrypt(s):\n result = []\n for ch in s:\n if 'a' <= ch <= 'z':\n base = ord('a')\n shifted = (ord(ch) - base - 4) % 26 + base\n result.append(chr(shifted))\n else:\n result.append(ch)\n return ''.join(result)", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
436
|
+
{"id": "code-verifier/435", "task_id": "HumanEval/83", "entry_point": "starts_one_ends", "prompt": "\ndef starts_one_ends(n):\n \"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"\n", "solution": "def starts_one_ends(n):\n \"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"\n if n == 1:\n return 1\n return 18 * (10 ** (n - 2))", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
437
|
+
{"id": "code-verifier/436", "task_id": "HumanEval/160", "entry_point": "do_algebra", "prompt": "\ndef do_algebra(operator, operand):\n \"\"\"\n Given two lists operator, and operand. The first list has basic algebra operations, and \n the second list is a list of integers. Use the two given lists to build the algebric \n expression and return the evaluation of this expression.\n\n The basic algebra operations:\n Addition ( + ) \n Subtraction ( - ) \n Multiplication ( * ) \n Floor division ( // ) \n Exponentiation ( ** ) \n\n Example:\n operator['+', '*', '-']\n array = [2, 3, 4, 5]\n result = 2 + 3 * 4 - 5\n => result = 9\n\n Note:\n The length of operator list is equal to the length of operand list minus one.\n Operand is a list of of non-negative integers.\n Operator list has at least one operator, and operand list has at least two operands.\n\n \"\"\"\n", "solution": "def do_algebra(operator, operand):\n result = operand[0]\n for i in range(len(operator)):\n op = operator[i]\n next_val = operand[i + 1]\n if op == '+':\n result += next_val\n elif op == '-':\n result -= next_val\n elif op == '*':\n result *= next_val\n elif op == '//':\n result //= next_val\n elif op == '**':\n result **= next_val\n return result", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
438
|
+
{"id": "code-verifier/437", "task_id": "HumanEval/116", "entry_point": "sort_array", "prompt": "\ndef sort_array(arr):\n \"\"\"\n In this Kata, you have to sort an array of non-negative integers according to\n number of ones in their binary representation in ascending order.\n For similar number of ones, sort based on decimal value.\n\n It must be implemented like this:\n >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n \"\"\"\n", "solution": "def sort_array(arr):\n def count_ones(n):\n return bin(n).count('1')\n\n # The sorting key is a tuple: (number of ones, the number itself)\n # Python's sort will use the first element for primary sorting,\n # and the second element for tie-breaking.\n return sorted(arr, key=lambda x: (count_ones(x), x))", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
439
|
+
{"id": "code-verifier/438", "task_id": "HumanEval/108", "entry_point": "count_nums", "prompt": "\ndef count_nums(arr):\n \"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n \"\"\"\n", "solution": "def count_nums(arr):\n def sum_signed_digits(n):\n if n == 0:\n return 0\n sign = -1 if n < 0 else 1\n s = 0\n while n != 0:\n digit = abs(n) % 10\n s += sign * digit\n n //= 10\n return s\n \n count = 0\n for num in arr:\n if sum_signed_digits(num) > 0:\n count += 1\n return count", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
440
|
+
{"id": "code-verifier/439", "task_id": "HumanEval/95", "entry_point": "check_dict_case", "prompt": "\ndef check_dict_case(dict):\n \"\"\"\n Given a dictionary, return True if all keys are strings in lower \n case or all keys are strings in upper case, else return False.\n The function should return False is the given dictionary is empty.\n Examples:\n check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n check_dict_case({\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}) should return False.\n check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n \"\"\"\n", "solution": "def check_dict_case(dict):\n if not dict:\n return False\n keys = list(dict.keys())\n if not all(isinstance(k, str) for k in keys):\n return False\n if not all(k.islower() for k in keys):\n if not all(k.isupper() for k in keys):\n return False\n return True", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
441
|
+
{"id": "code-verifier/440", "task_id": "HumanEval/26", "entry_point": "remove_duplicates", "prompt": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n", "solution": "from typing import List\n\n\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n \"\"\" From a list of integers, remove all elements that occur more than once.\n Keep order of elements left the same as in the input.\n >>> remove_duplicates([1, 2, 3, 2, 4])\n [1, 3, 4]\n \"\"\"\n seen = set()\n result = []\n for n in numbers:\n if n not in seen:\n seen.add(n)\n result.append(n)\n return result", "passes": false, "model": "lfm2.5-8b-a1b-dspark", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
442
|
+
{"id": "code-verifier/441", "task_id": "HumanEval/97", "entry_point": "multiply", "prompt": "\ndef multiply(a, b):\n \"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n multiply(148, 412) should return 16.\n multiply(19, 28) should return 72.\n multiply(2020, 1851) should return 0.\n multiply(14,-15) should return 20.\n \"\"\"\n", "solution": "def multiply(a, b):\n return (abs(a) % 10) * (abs(b) % 10)", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
443
|
+
{"id": "code-verifier/442", "task_id": "HumanEval/126", "entry_point": "is_sorted", "prompt": "\ndef is_sorted(lst):\n '''\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) ➞ True\n is_sorted([1, 2, 3, 4, 5]) ➞ True\n is_sorted([1, 3, 2, 4, 5]) ➞ False\n is_sorted([1, 2, 3, 4, 5, 6]) ➞ True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) ➞ True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) ➞ False\n is_sorted([1, 2, 2, 3, 3, 4]) ➞ True\n is_sorted([1, 2, 2, 2, 3, 4]) ➞ False\n '''\n", "solution": "def is_sorted(lst):\n if len(lst) != len(set(lst)):\n return False\n for i in range(len(lst)-1):\n if lst[i] > lst[i+1]:\n return False\n return True", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
444
|
+
{"id": "code-verifier/443", "task_id": "HumanEval/54", "entry_point": "same_chars", "prompt": "\n\ndef same_chars(s0: str, s1: str):\n \"\"\"\n Check if two words have the same characters.\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n True\n >>> same_chars('abcd', 'dddddddabc')\n True\n >>> same_chars('dddddddabc', 'abcd')\n True\n >>> same_chars('eabcd', 'dddddddabc')\n False\n >>> same_chars('abcd', 'dddddddabce')\n False\n >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n False\n \"\"\"\n", "solution": "def same_chars(s0: str, s1: str):\n return set(s0) == set(s1)", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
445
|
+
{"id": "code-verifier/444", "task_id": "HumanEval/109", "entry_point": "move_one_ball", "prompt": "\ndef move_one_ball(arr):\n \"\"\"We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n numbers in the array will be randomly ordered. Your task is to determine if\n it is possible to get an array sorted in non-decreasing order by performing \n the following operation on the given array:\n You are allowed to perform right shift operation any number of times.\n \n One right shift operation means shifting all elements of the array by one\n position in the right direction. The last element of the array will be moved to\n the starting position in the array i.e. 0th index. \n\n If it is possible to obtain the sorted array by performing the above operation\n then return True else return False.\n If the given array is empty then return True.\n\n Note: The given list is guaranteed to have unique elements.\n\n For Example:\n \n move_one_ball([3, 4, 5, 1, 2])==>True\n Explanation: By performin 2 right shift operations, non-decreasing order can\n be achieved for the given array.\n move_one_ball([3, 5, 4, 1, 2])==>False\n Explanation:It is not possible to get non-decreasing order for the given\n array by performing any number of right shift operations.\n \n \"\"\"\n", "solution": "def move_one_ball(arr):\n if len(arr) <= 1:\n return True\n n = len(arr)\n # Check if the array is already sorted in non-decreasing order\n if all(arr[i] <= arr[i+1] for i in range(n-1)):\n return True\n \n # Count how many times an element is followed by a smaller one (inversions)\n inversions = 0\n for i in range(n):\n if arr[i] > arr[(i + 1) % n]:\n inversions += 1\n \n # If there are no inversions, the array is already sorted.\n # Otherwise, check if exactly one inversion exists and it forms a rotation that sorts the array.\n if inversions == 0:\n return True\n elif inversions == 1:\n # Find the index where the drop occurs (arr[i] > arr[(i+1)%n])\n for i in range(n):\n if arr[i] > arr[(i + 1) % n]:\n # Check if rotating left by (n - i - 1) positions sorts the array\n rotated = arr[n-i-1:] + arr[:n-i-1]\n return all(rotated[j] <= rotated[j+1] for j in range(n-1))\n return False", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
446
|
+
{"id": "code-verifier/445", "task_id": "HumanEval/121", "entry_point": "solution", "prompt": "\ndef solution(lst):\n \"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n \n\n Examples\n solution([5, 8, 7, 1]) ==> 12\n solution([3, 3, 3, 3, 3]) ==> 9\n solution([30, 13, 24, 321]) ==>0\n \"\"\"\n", "solution": "def solution(lst):\n total = 0\n for i, val in enumerate(lst):\n if i % 2 == 0 and val % 2 != 0:\n total += val\n return total", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
447
|
+
{"id": "code-verifier/446", "task_id": "HumanEval/103", "entry_point": "rounded_avg", "prompt": "\ndef rounded_avg(n, m):\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\n", "solution": "def rounded_avg(n, m):\n if n > m:\n return -1\n total = (n + m) * (m - n + 1) // 2\n avg = round(total / (m - n + 1))\n return bin(avg)[2:]", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
448
|
+
{"id": "code-verifier/447", "task_id": "HumanEval/49", "entry_point": "modp", "prompt": "\n\ndef modp(n: int, p: int):\n \"\"\"Return 2^n modulo p (be aware of numerics).\n >>> modp(3, 5)\n 3\n >>> modp(1101, 101)\n 2\n >>> modp(0, 101)\n 1\n >>> modp(3, 11)\n 8\n >>> modp(100, 101)\n 1\n \"\"\"\n", "solution": "def modp(n: int, p: int):\n return pow(2, n, p)", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
449
|
+
{"id": "code-verifier/448", "task_id": "HumanEval/110", "entry_point": "exchange", "prompt": "\ndef exchange(lst1, lst2):\n \"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n It is assumed that the input lists will be non-empty.\n \"\"\"\n", "solution": "def exchange(lst1, lst2):\n odd_in_lst1 = sum(1 for x in lst1 if x % 2 != 0)\n odd_in_lst2 = sum(1 for x in lst2 if x % 2 != 0)\n if odd_in_lst1 <= odd_in_lst2:\n return \"YES\"\n else:\n return \"NO\"", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
450
|
+
{"id": "code-verifier/449", "task_id": "HumanEval/145", "entry_point": "order_by_points", "prompt": "\ndef order_by_points(nums):\n \"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n >>> order_by_points([]) == []\n \"\"\"\n", "solution": "def order_by_points(nums):\n def digit_sum(n):\n s = str(n)\n if s[0] == '-':\n return -int(s[1]) + sum(int(d) for d in s[2:])\n return sum(int(d) for d in s)\n return sorted(nums, key=digit_sum)", "passes": true, "model": "qwen3.8-27b-q4-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
451
|
+
{"id": "code-verifier/450", "task_id": "HumanEval/125", "entry_point": "split_words", "prompt": "\ndef split_words(txt):\n '''\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n split_words(\"Hello world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"Hello,world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"abcdef\") == 3 \n '''\n", "solution": "\ndef split_words(txt):\n '''\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n split_words(\"Hello world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"Hello,world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"abcdef\") == 3 \n '''\n if ' ' in txt:\n return txt.split(' ')\n elif ',' in txt:\n return txt.split(',')\n else:\n count = 0\n for i in range(26):\n char = chr(ord('a') + i)\n if i % 2 != 0:\n count += 1\n return count", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
452
|
+
{"id": "code-verifier/451", "task_id": "HumanEval/76", "entry_point": "is_simple_power", "prompt": "\ndef is_simple_power(x, n):\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \"\"\"\n", "solution": "\ndef is_simple_power(x, n):\n \"\"\"Your task is to write a function that returns true if a number x is a simple\n power of n and false in other cases.\n x is a simple power of n if n**int=x\n For example:\n is_simple_power(1, 4) => true\n is_simple_power(2, 2) => true\n is_simple_power(8, 2) => true\n is_simple_power(3, 2) => false\n is_simple_power(3, 1) => false\n is_simple_power(5, 3) => false\n \"\"\"\n if x == 1:\n return True\n if n == 0:\n return x == 0\n if n == 1:\n return False\n if n == -1:\n return x == -1\n if n > 0:\n if x <= 0:\n return False\n while x > 1:\n if x % n != 0:\n return False\n x //= n\n return True\n abs_n = -n\n abs_x = abs(x)\n if abs_x == 0:\n return False\n k = 0\n while abs_x > 1:\n if abs_x % abs_n != 0:\n return False\n abs_x //= abs_n\n k += 1\n return (k % 2 == 0) == (x > 0)", "passes": true, "model": "qwen3.8-27b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
453
|
+
{"id": "code-verifier/452", "task_id": "HumanEval/97", "entry_point": "multiply", "prompt": "\ndef multiply(a, b):\n \"\"\"Complete the function that takes two integers and returns \n the product of their unit digits.\n Assume the input is always valid.\n Examples:\n multiply(148, 412) should return 16.\n multiply(19, 28) should return 72.\n multiply(2020, 1851) should return 0.\n multiply(14,-15) should return 20.\n \"\"\"\n", "solution": "def multiply(a, b):\n return (a % 10) * (b % 10)", "passes": false, "model": "qwen3.8-27b-mtp-nothink", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
454
|
+
{"id": "code-verifier/453", "task_id": "HumanEval/119", "entry_point": "match_parens", "prompt": "\ndef match_parens(lst):\n '''\n You are given a list of two strings, both strings consist of open\n parentheses '(' or close parentheses ')' only.\n Your job is to check if it is possible to concatenate the two strings in\n some order, that the resulting string will be good.\n A string S is considered to be good if and only if all parentheses in S\n are balanced. For example: the string '(())()' is good, while the string\n '())' is not.\n Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n Examples:\n match_parens(['()(', ')']) == 'Yes'\n match_parens([')', ')']) == 'No'\n '''\n", "solution": "def match_parens(lst):\n a, b = lst\n def analyze(s):\n bal = 0\n min_bal = 0\n for ch in s:\n if ch == '(':\n bal += 1\n else:\n bal -= 1\n if bal < min_bal:\n min_bal = bal\n return bal, min_bal\n diff_a, min_a = analyze(a)\n diff_b, min_b = analyze(b)\n total_diff = diff_a + diff_b\n if total_diff != 0:\n return 'No'\n if min_a >= 0 and (diff_a + min_b) >= 0:\n return 'Yes'\n if min_b >= 0 and (diff_b + min_a) >= 0:\n return 'Yes'\n return 'No'", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
455
|
+
{"id": "code-verifier/454", "task_id": "HumanEval/40", "entry_point": "triples_sum_to_zero", "prompt": "\n\ndef triples_sum_to_zero(l: list):\n \"\"\"\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n >>> triples_sum_to_zero([1, 3, 5, 0])\n False\n >>> triples_sum_to_zero([1, 3, -2, 1])\n True\n >>> triples_sum_to_zero([1, 2, 3, 7])\n False\n >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n True\n >>> triples_sum_to_zero([1])\n False\n \"\"\"\n", "solution": "\n\ndef triples_sum_to_zero(l: list):\n \"\"\"\n triples_sum_to_zero takes a list of integers as an input.\n it returns True if there are three distinct elements in the list that\n sum to zero, and False otherwise.\n\n >>> triples_sum_to_zero([1, 3, 5, 0])\n False\n >>> triples_sum_to_zero([1, 3, -2, 1])\n True\n >>> triples_sum_to_zero([1, 2, 3, 7])\n False\n >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n True\n >>> triples_sum_to_zero([1])\n False\n \"\"\"\n for i in range(len(l)):\n for j in range(i + 1, len(l)):\n for k in range(j + 1, len(l)):\n if l[i] + l[j] + l[k] == 0:\n return True\n for i in range(len(l) - 2):\n left = l[i]\n for j in range(i + 1, len(l) - 1):\n right = l[j]\n if left + right == -left and left != right:\n continue\n if left + right + l[-1] == 0:\n return True", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
456
|
+
{"id": "code-verifier/455", "task_id": "HumanEval/71", "entry_point": "triangle_area", "prompt": "\ndef triangle_area(a, b, c):\n '''\n Given the lengths of the three sides of a triangle. Return the area of\n the triangle rounded to 2 decimal points if the three sides form a valid triangle. \n Otherwise return -1\n Three sides make a valid triangle when the sum of any two sides is greater \n than the third side.\n Example:\n triangle_area(3, 4, 5) == 6.00\n triangle_area(1, 2, 10) == -1\n '''\n", "solution": "def triangle_area(a, b, c):\n if a + b <= c or a + c <= b or b + c <= a:\n return -1\n s = (a + b + c) / 2\n area = (s * (s - a) * (s - b) * (s - c)) ** 0.5\n return round(area, 2)", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
457
|
+
{"id": "code-verifier/456", "task_id": "HumanEval/135", "entry_point": "can_arrange", "prompt": "\ndef can_arrange(arr):\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \"\"\"\n", "solution": "\ndef can_arrange(arr):\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \"\"\"\n if not arr:\n return -1\n\n for i in range(1, len(arr)):\n if arr[i] >= arr[i-1]:\n return i\n\n return -1", "passes": false, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
458
|
+
{"id": "code-verifier/457", "task_id": "HumanEval/50", "entry_point": "decode_shift", "prompt": "\n\ndef encode_shift(s: str):\n \"\"\"\n returns encoded string by shifting every character by 5 in the alphabet.\n \"\"\"\n return \"\".join([chr(((ord(ch) + 5 - ord(\"a\")) % 26) + ord(\"a\")) for ch in s])\n\n\ndef decode_shift(s: str):\n \"\"\"\n takes as input string encoded with encode_shift function. Returns decoded string.\n \"\"\"\n", "solution": "\n\ndef encode_shift(s: str):\n \"\"\"\n returns encoded string by shifting every character by 5 in the alphabet.\n \"\"\"\n return \"\".join([chr(((ord(ch) + 5 - ord(\"a\")) % 26) + ord(\"a\")) for ch in s])\n\n\ndef decode_shift(s: str):\n \"\"\"\n takes as input string encoded with encode_shift function. Returns decoded string.\n \"\"\"\n return \"\".join([chr(((ord(ch) - ord(\"a\") - 5) % 26) + ord(\"a\")) for ch in s])", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
459
|
+
{"id": "code-verifier/458", "task_id": "HumanEval/126", "entry_point": "is_sorted", "prompt": "\ndef is_sorted(lst):\n '''\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) ➞ True\n is_sorted([1, 2, 3, 4, 5]) ➞ True\n is_sorted([1, 3, 2, 4, 5]) ➞ False\n is_sorted([1, 2, 3, 4, 5, 6]) ➞ True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) ➞ True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) ➞ False\n is_sorted([1, 2, 2, 3, 3, 4]) ➞ True\n is_sorted([1, 2, 2, 2, 3, 4]) ➞ False\n '''\n", "solution": "def is_sorted(lst):\n for i in range(len(lst) - 1):\n if lst[i] >= lst[i + 1]:\n return False\n return True", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
460
|
+
{"id": "code-verifier/459", "task_id": "HumanEval/77", "entry_point": "iscube", "prompt": "\ndef iscube(a):\n '''\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n iscube(1) ==> True\n iscube(2) ==> False\n iscube(-1) ==> True\n iscube(64) ==> True\n iscube(0) ==> True\n iscube(180) ==> False\n '''\n", "solution": "def iscube(a):\n if a >= 0:\n root = int(round(a ** (1/3)))\n else:\n root = -int(round((-a) ** (1/3)))\n return root * root * root == a", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
461
|
+
{"id": "code-verifier/460", "task_id": "HumanEval/77", "entry_point": "iscube", "prompt": "\ndef iscube(a):\n '''\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n iscube(1) ==> True\n iscube(2) ==> False\n iscube(-1) ==> True\n iscube(64) ==> True\n iscube(0) ==> True\n iscube(180) ==> False\n '''\n", "solution": "def iscube(a):\n if a == 0:\n return True\n if a > 0:\n n = round(a ** (1/3))\n return n ** 3 == a\n else:\n n = round(-a ** (1/3))\n return (-n) ** 3 == a", "passes": false, "model": "qwen3.8-27b-mtp-nothink", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
462
|
+
{"id": "code-verifier/461", "task_id": "HumanEval/151", "entry_point": "double_the_difference", "prompt": "\ndef double_the_difference(lst):\n '''\n Given a list of numbers, return the sum of squares of the numbers\n in the list that are odd. Ignore numbers that are negative or not integers.\n \n double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n double_the_difference([-1, -2, 0]) == 0\n double_the_difference([9, -2]) == 81\n double_the_difference([0]) == 0 \n \n If the input list is empty, return 0.\n '''\n", "solution": "def double_the_difference(lst):\n total = 0\n for x in lst:\n if isinstance(x, int) and x % 2 != 0 and x > 0:\n total += x * x\n return total", "passes": true, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
463
|
+
{"id": "code-verifier/462", "task_id": "HumanEval/150", "entry_point": "x_or_y", "prompt": "\ndef x_or_y(n, x, y):\n \"\"\"A simple program which should return the value of x if n is \n a prime number and should return the value of y otherwise.\n\n Examples:\n for x_or_y(7, 34, 12) == 34\n for x_or_y(15, 8, 5) == 5\n \n \"\"\"\n", "solution": "def x_or_y(n, x, y):\n if all(n % i for i in range(2, int(n**0.5)+1)):\n return x\n else:\n return y", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
464
|
+
{"id": "code-verifier/463", "task_id": "HumanEval/103", "entry_point": "rounded_avg", "prompt": "\ndef rounded_avg(n, m):\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\n", "solution": "\ndef rounded_avg(n, m):\n \"\"\"You are given two positive integers n and m, and your task is to compute the\n average of the integers from n through m (including n and m). \n Round the answer to the nearest integer and convert that to binary.\n If n is greater than m, return -1.\n Example:\n rounded_avg(1, 5) => \"0b11\"\n rounded_avg(7, 5) => -1\n rounded_avg(10, 20) => \"0b1111\"\n rounded_avg(20, 33) => \"0b11010\"\n \"\"\"\n if n > m:\n return -1\n avg = round((n + m) / 2)\n return bin(avg)", "passes": true, "model": "qwen3.8-27b-q4-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
465
|
+
{"id": "code-verifier/464", "task_id": "HumanEval/106", "entry_point": "f", "prompt": "\ndef f(n):\n \"\"\" Implement the function f that takes n as a parameter,\n and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even\n or the sum of numbers from 1 to i otherwise.\n i starts from 1.\n the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n Example:\n f(5) == [1, 2, 6, 24, 15]\n \"\"\"\n", "solution": "def f(n):\n result = []\n for i in range(1, n + 1):\n if i % 2 == 0:\n result.append(factorial(i))\n else:\n result.append(sum(range(1, i + 1)))\n return result", "passes": false, "model": "lfm2.5-1.2b-instruct", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
466
|
+
{"id": "code-verifier/465", "task_id": "HumanEval/24", "entry_point": "largest_divisor", "prompt": "\n\ndef largest_divisor(n: int) -> int:\n \"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15)\n 5\n \"\"\"\n", "solution": "\n\ndef largest_divisor(n: int) -> int:\n \"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n >>> largest_divisor(15)\n 5\n \"\"\"\n if n <= 1:\n return 1\n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n return n // i\n return 1", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
467
|
+
{"id": "code-verifier/466", "task_id": "HumanEval/84", "entry_point": "solve", "prompt": "\ndef solve(N):\n \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n \n Example\n For N = 1000, the sum of digits will be 1 the output should be \"1\".\n For N = 150, the sum of digits will be 6 the output should be \"110\".\n For N = 147, the sum of digits will be 12 the output should be \"1100\".\n \n Variables:\n @N integer\n Constraints: 0 ≤ N ≤ 10000.\n Output:\n a string of binary number\n \"\"\"\n", "solution": "def solve(N):\n total = 0\n while N:\n total += N & 1\n N >>= 1\n return bin(total)[2:]", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
468
|
+
{"id": "code-verifier/467", "task_id": "HumanEval/129", "entry_point": "minPath", "prompt": "\ndef minPath(grid, k):\n \"\"\"\n Given a grid with N rows and N columns (N >= 2) and a positive integer k, \n each cell of the grid contains a value. Every integer in the range [1, N * N]\n inclusive appears exactly once on the cells of the grid.\n\n You have to find the minimum path of length k in the grid. You can start\n from any cell, and in each step you can move to any of the neighbor cells,\n in other words, you can go to cells which share an edge with you current\n cell.\n Please note that a path of length k means visiting exactly k cells (not\n necessarily distinct).\n You CANNOT go off the grid.\n A path A (of length k) is considered less than a path B (of length k) if\n after making the ordered lists of the values on the cells that A and B go\n through (let's call them lst_A and lst_B), lst_A is lexicographically less\n than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n lst_A[j] = lst_B[j].\n It is guaranteed that the answer is unique.\n Return an ordered list of the values on the cells that the minimum path go through.\n\n Examples:\n\n Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n Output: [1, 2, 1]\n\n Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n Output: [1]\n \"\"\"\n", "solution": "def minPath(grid, k):\n n = len(grid)\n min_val = None\n min_r = min_c = 0\n for i in range(n):\n for j in range(len(grid[i])):\n if min_val is None or grid[i][j] < min_val:\n min_val = grid[i][j]\n min_r, min_c = i, j\n\n neighbor_min = None\n for dr, dc in ((-1, 0), (1, 0), (0, -1), (0, 1)):\n r, c = min_r + dr, min_c + dc\n if 0 <= r < n and 0 <= c < len(grid[r]):\n val = grid[r][c]\n if neighbor_min is None or val < neighbor_min:\n neighbor_min = val\n\n if neighbor_min is None:\n return [min_val] * k\n return [min_val if i % 2 == 0 else neighbor_min for i in range(k)]", "passes": true, "model": "qwen3.8-27b-mtp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
469
|
+
{"id": "code-verifier/468", "task_id": "HumanEval/104", "entry_point": "unique_digits", "prompt": "\ndef unique_digits(x):\n \"\"\"Given a list of positive integers x. return a sorted list of all \n elements that hasn't any even digit.\n\n Note: Returned list should be sorted in increasing order.\n \n For example:\n >>> unique_digits([15, 33, 1422, 1])\n [1, 15, 33]\n >>> unique_digits([152, 323, 1422, 10])\n []\n \"\"\"\n", "solution": "def unique_digits(x):\n def has_even_digit(n):\n return any(d % 2 == 0 for d in str(n))\n return sorted([n for n in x if not has_even_digit(n)])", "passes": false, "model": "qwen3.8-27b-mtp-nothink", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
470
|
+
{"id": "code-verifier/469", "task_id": "HumanEval/131", "entry_point": "digits", "prompt": "\ndef digits(n):\n \"\"\"Given a positive integer n, return the product of the odd digits.\n Return 0 if all digits are even.\n For example:\n digits(1) == 1\n digits(4) == 0\n digits(235) == 15\n \"\"\"\n", "solution": "def digits(n):\n product = 1\n has_odd = False\n while n > 0:\n digit = n % 10\n if digit % 2 != 0:\n product *= digit\n has_odd = True\n n //= 10\n return product if has_odd else 0", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
471
|
+
{"id": "code-verifier/470", "task_id": "HumanEval/118", "entry_point": "get_closest_vowel", "prompt": "\ndef get_closest_vowel(word):\n \"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n get_closest_vowel(\"yogurt\") ==> \"u\"\n get_closest_vowel(\"FULL\") ==> \"U\"\n get_closest_vowel(\"quick\") ==> \"\"\n get_closest_vowel(\"ab\") ==> \"\"\n \"\"\"\n", "solution": "def get_closest_vowel(word):\n vowels = {'a', 'e', 'i', 'o', 'u'}\n n = len(word)\n for i in range(n - 2, -1, -1):\n if word[i] not in vowels:\n continue\n left = (i - 1) >= 0 and word[i-1].lower() in vowels\n right = (i + 1) < n and word[i+1].lower() in vowels\n if left or right:\n return word[i]\n return \"\"", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
472
|
+
{"id": "code-verifier/471", "task_id": "HumanEval/108", "entry_point": "count_nums", "prompt": "\ndef count_nums(arr):\n \"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n \"\"\"\n", "solution": "def count_nums(arr):\n count = 0\n for num in arr:\n s = str(num)\n digit_sum = 0\n is_negative = False\n start_index = 0\n if s.startswith('-'):\n is_negative = True\n start_index = 1\n \n for char in s[start_index:]:\n digit = int(char)\n if is_negative and start_index == 1:\n # This logic is tricky based on the example: -123 has signed digits -1, 2, and 3.\n # This implies the sign applies only to the first digit if it's negative.\n # Let's re-evaluate the requirement based on the example:\n # -123 -> digits are -1, 2, 3. Sum = -1 + 2 + 3 = 4. 4 > 0. Count it.\n # If the number was -10, digits are -1, 0. Sum = -1. Not > 0.\n \n # Let's implement the interpretation:\n # If negative, the first digit is negative, subsequent digits are positive.\n pass # We will handle this in the loop below\n \n current_sum = 0\n \n if num >= 0:\n for char in str(num):\n current_sum += int(char)\n else:\n s_num = str(num)\n # First digit is negative\n first_digit = int(s_num[1])\n current_sum += -first_digit\n \n # Remaining digits are positive\n for char in s_num[2:]:\n current_sum += int(char)\n \n if current_sum > 0:\n count += 1\n \n return count", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
473
|
+
{"id": "code-verifier/472", "task_id": "HumanEval/145", "entry_point": "order_by_points", "prompt": "\ndef order_by_points(nums):\n \"\"\"\n Write a function which sorts the given list of integers\n in ascending order according to the sum of their digits.\n Note: if there are several items with similar sum of their digits,\n order them based on their index in original list.\n\n For example:\n >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n >>> order_by_points([]) == []\n \"\"\"\n", "solution": "def order_by_points(nums):\n def digit_sum(n):\n return sum(int(d) for d in str(abs(n)))\n \n indexed = list(enumerate(nums))\n sorted_indexed = sorted(indexed, key=lambda x: (digit_sum(x[1]), x[0]))\n result = [num for _, num in sorted_indexed]\n return result", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
474
|
+
{"id": "code-verifier/473", "task_id": "HumanEval/142", "entry_point": "sum_squares", "prompt": "\n\n\ndef sum_squares(lst):\n \"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n For lst = [1,2,3] the output should be 6\n For lst = [] the output should be 0\n For lst = [-1,-5,2,-1,-5] the output should be -126\n \"\"\"\n", "solution": "\n\n\ndef sum_squares(lst):\n \"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n For lst = [1,2,3] the output should be 6\n For lst = [] the output should be 0\n For lst = [-1,-5,2,-1,-5] the output should be -126\n \"\"\"\n total_sum = 0\n for i, num in enumerate(lst):\n if i % 3 == 0:\n total_sum += num ** 2\n elif i % 4 == 0 and i % 3 != 0:\n total_sum += num ** 3\n else:\n total_sum += num\n return total_sum", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
475
|
+
{"id": "code-verifier/474", "task_id": "HumanEval/120", "entry_point": "maximum", "prompt": "\ndef maximum(arr, k):\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n Input: arr = [-3, -4, 5], k = 3\n Output: [-4, -3, 5]\n\n Example 2:\n\n Input: arr = [4, -4, 4], k = 2\n Output: [4, 4]\n\n Example 3:\n\n Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n Output: [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n", "solution": "\ndef maximum(arr, k):\n \"\"\"\n Given an array arr of integers and a positive integer k, return a sorted list \n of length k with the maximum k numbers in arr.\n\n Example 1:\n\n Input: arr = [-3, -4, 5], k = 3\n Output: [-4, -3, 5]\n\n Example 2:\n\n Input: arr = [4, -4, 4], k = 2\n Output: [4, 4]\n\n Example 3:\n\n Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n Output: [2]\n\n Note:\n 1. The length of the array will be in the range of [1, 1000].\n 2. The elements in the array will be in the range of [-1000, 1000].\n 3. 0 <= k <= len(arr)\n \"\"\"\n arr.sort(reverse=True)\n return arr[:k]", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
476
|
+
{"id": "code-verifier/475", "task_id": "HumanEval/86", "entry_point": "anti_shuffle", "prompt": "\ndef anti_shuffle(s):\n \"\"\"\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n anti_shuffle('Hi') returns 'Hi'\n anti_shuffle('hello') returns 'ehllo'\n anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\n \"\"\"\n", "solution": "\ndef anti_shuffle(s):\n \"\"\"\n Write a function that takes a string and returns an ordered version of it.\n Ordered version of string, is a string where all words (separated by space)\n are replaced by a new word where all the characters arranged in\n ascending order based on ascii value.\n Note: You should keep the order of words and blank spaces in the sentence.\n\n For example:\n anti_shuffle('Hi') returns 'Hi'\n anti_shuffle('hello') returns 'ehllo'\n anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\n \"\"\"\n words = s.split(' ')\n ordered_words = []\n for word in words:\n sorted_chars = sorted(word)\n ordered_words.append(\"\".join(sorted_chars))\n return \" \".join(ordered_words)", "passes": true, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
477
|
+
{"id": "code-verifier/476", "task_id": "HumanEval/83", "entry_point": "starts_one_ends", "prompt": "\ndef starts_one_ends(n):\n \"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"\n", "solution": "def starts_one_ends(n):\n \"\"\"\n Given a positive integer n, return the count of the numbers of n-digit\n positive integers that start or end with 1.\n \"\"\"\n total = 0\n # Count numbers that start with 1\n start_count = 10**(n-1) # All numbers with n digits starting with 1\n # Count numbers that end with 1\n end_count = 10**(n-1) # All numbers with n digits ending with 1\n # Subtract overlap (numbers that both start and end with 1)\n overlap = 10**(n-2) # Numbers with n digits that start and end with 1\n return start_count + end_count - overlap", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
478
|
+
{"id": "code-verifier/477", "task_id": "HumanEval/127", "entry_point": "intersection", "prompt": "\ndef intersection(interval1, interval2):\n \"\"\"You are given two intervals,\n where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n The given intervals are closed which means that the interval (start, end)\n includes both start and end.\n For each given interval, it is assumed that its start is less or equal its end.\n Your task is to determine whether the length of intersection of these two \n intervals is a prime number.\n Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n which its length is 1, which not a prime number.\n If the length of the intersection is a prime number, return \"YES\",\n otherwise, return \"NO\".\n If the two intervals don't intersect, return \"NO\".\n\n\n [input/output] samples:\n intersection((1, 2), (2, 3)) ==> \"NO\"\n intersection((-1, 1), (0, 4)) ==> \"NO\"\n intersection((-3, -1), (-5, 5)) ==> \"YES\"\n \"\"\"\n", "solution": "def intersection(interval1, interval2):\n s1, e1 = interval1\n s2, e2 = interval2\n start = max(s1, s2)\n end = min(e1, e2)\n length = end - start\n if length <= 0:\n return \"NO\"\n if length < 2:\n return \"NO\"\n for i in range(2, int(length**0.5) + 1):\n if length % i == 0:\n return \"NO\"\n return \"YES\"", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
479
|
+
{"id": "code-verifier/478", "task_id": "HumanEval/142", "entry_point": "sum_squares", "prompt": "\n\n\ndef sum_squares(lst):\n \"\"\"\"\n This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a \n multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not \n change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries. \n \n Examples:\n For lst = [1,2,3] the output should be 6\n For lst = [] the output should be 0\n For lst = [-1,-5,2,-1,-5] the output should be -126\n \"\"\"\n", "solution": "def sum_squares(lst):\n total = 0\n for i, num in enumerate(lst):\n if i % 3 == 0:\n total += num ** 2\n elif i % 4 == 0:\n total += num ** 3\n return total", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
480
|
+
{"id": "code-verifier/479", "task_id": "HumanEval/163", "entry_point": "generate_integers", "prompt": "\ndef generate_integers(a, b):\n \"\"\"\n Given two positive integers a and b, return the even digits between a\n and b, in ascending order.\n\n For example:\n generate_integers(2, 8) => [2, 4, 6, 8]\n generate_integers(8, 2) => [2, 4, 6, 8]\n generate_integers(10, 14) => []\n \"\"\"\n", "solution": "def generate_integers(a, b):\n lo, hi = min(a, b), max(a, b)\n return [d for d in range(0, 9, 2) if lo <= d <= hi]", "passes": true, "model": "qwen3.8-27b-mtp-low", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
481
|
+
{"id": "code-verifier/480", "task_id": "HumanEval/110", "entry_point": "exchange", "prompt": "\ndef exchange(lst1, lst2):\n \"\"\"In this problem, you will implement a function that takes two lists of numbers,\n and determines whether it is possible to perform an exchange of elements\n between them to make lst1 a list of only even numbers.\n There is no limit on the number of exchanged elements between lst1 and lst2.\n If it is possible to exchange elements between the lst1 and lst2 to make\n all the elements of lst1 to be even, return \"YES\".\n Otherwise, return \"NO\".\n For example:\n exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n It is assumed that the input lists will be non-empty.\n \"\"\"\n", "solution": "def exchange(lst1, lst2):\n odd_in_lst1 = [x for x in lst1 if x % 2 != 0]\n even_in_lst2 = [x for x in lst2 if x % 2 == 0]\n\n return len(odd_in_lst1) <= len(even_in_lst2)", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
482
|
+
{"id": "code-verifier/481", "task_id": "HumanEval/152", "entry_point": "compare", "prompt": "\ndef compare(game,guess):\n \"\"\"I think we all remember that feeling when the result of some long-awaited\n event is finally known. The feelings and thoughts you have at that moment are\n definitely worth noting down and comparing.\n Your task is to determine if a person correctly guessed the results of a number of matches.\n You are given two arrays of scores and guesses of equal length, where each index shows a match. \n Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n the value is 0, and if not, the value is the absolute difference between the guess and the score.\n \n \n example:\n\n compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\n \"\"\"\n", "solution": "def compare(game, guess):\n return [abs(g - s) for g, s in zip(guess, game)]", "passes": true, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
483
|
+
{"id": "code-verifier/482", "task_id": "HumanEval/130", "entry_point": "tri", "prompt": "\ndef tri(n):\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to a return a list of the \n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\n", "solution": "def tri(n):\n \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n the last couple centuries. However, what people don't know is Tribonacci sequence.\n Tribonacci sequence is defined by the recurrence:\n tri(1) = 3\n tri(n) = 1 + n / 2, if n is even.\n tri(n) = tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n For example:\n tri(2) = 1 + (2 / 2) = 2\n tri(4) = 3\n tri(3) = tri(2) + tri(1) + tri(4)\n = 2 + 3 + 3 = 8 \n You are given a non-negative integer number n, you have to return a list of the\n first n + 1 numbers of the Tribonacci sequence.\n Examples:\n tri(3) = [1, 3, 2, 8]\n \"\"\"\n if n == 0:\n return []\n seq = [3]\n if n >= 1:\n seq.append(2)\n for i in range(3, n + 1):\n if i % 2 == 0:\n val = 1 + i // 2\n else:\n prev2 = seq[i - 2]\n prev1 = seq[i - 3]\n next_val = 1 + (i + 1) // 2\n val = prev1 + prev2 + next_val\n seq.append(val)\n return seq", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
484
|
+
{"id": "code-verifier/483", "task_id": "HumanEval/125", "entry_point": "split_words", "prompt": "\ndef split_words(txt):\n '''\n Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n Examples\n split_words(\"Hello world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"Hello,world!\") ➞ [\"Hello\", \"world!\"]\n split_words(\"abcdef\") == 3 \n '''\n", "solution": "def split_words(txt):\n # Detect presence of any whitespace character in txt\n has_whitespace = any(c.isspace() for c in txt)\n \n if has_whitespace:\n # Split on whitespace (default str.split behavior)\n return txt.split()\n elif ',' in txt:\n # No whitespace but commas present: split on commas\n return txt.split(',')\n else:\n # Count lower-case letters with odd alphabetical index.\n count = 0\n for ch in txt:\n if 'a' <= ch <= 'z':\n # ord('a') is 97; mapping described as (ord(ch) - 97)\n if ((ord(ch) - 97) % 2 == 1):\n count += 1\n return count", "passes": true, "model": "minicpm5-2b-q4-bench-rp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
485
|
+
{"id": "code-verifier/484", "task_id": "HumanEval/126", "entry_point": "is_sorted", "prompt": "\ndef is_sorted(lst):\n '''\n Given a list of numbers, return whether or not they are sorted\n in ascending order. If list has more than 1 duplicate of the same\n number, return False. Assume no negative numbers and only integers.\n\n Examples\n is_sorted([5]) ➞ True\n is_sorted([1, 2, 3, 4, 5]) ➞ True\n is_sorted([1, 3, 2, 4, 5]) ➞ False\n is_sorted([1, 2, 3, 4, 5, 6]) ➞ True\n is_sorted([1, 2, 3, 4, 5, 6, 7]) ➞ True\n is_sorted([1, 3, 2, 4, 5, 6, 7]) ➞ False\n is_sorted([1, 2, 2, 3, 3, 4]) ➞ True\n is_sorted([1, 2, 2, 2, 3, 4]) ➞ False\n '''\n", "solution": "def is_sorted(lst):\n if len(set(lst)) != len(lst):\n return False\n return all(lst[i] <= lst[i+1] for i in range(len(lst)-1))", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
486
|
+
{"id": "code-verifier/485", "task_id": "HumanEval/89", "entry_point": "encrypt", "prompt": "\ndef encrypt(s):\n \"\"\"Create a function encrypt that takes a string as an argument and\n returns a string encrypted with the alphabet being rotated. \n The alphabet should be rotated in a manner such that the letters \n shift down by two multiplied to two places.\n For example:\n encrypt('hi') returns 'lm'\n encrypt('asdfghjkl') returns 'ewhjklnop'\n encrypt('gf') returns 'kj'\n encrypt('et') returns 'ix'\n \"\"\"\n", "solution": "def encrypt(s):\n result = []\n for c in s:\n if 'a' <= c <= 'z':\n shifted = chr((ord(c) - ord('a') + 4) % 26 + ord('a'))\n result.append(shifted)\n else:\n result.append(c)\n return ''.join(result)", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
487
|
+
{"id": "code-verifier/486", "task_id": "HumanEval/108", "entry_point": "count_nums", "prompt": "\ndef count_nums(arr):\n \"\"\"\n Write a function count_nums which takes an array of integers and returns\n the number of elements which has a sum of digits > 0.\n If a number is negative, then its first signed digit will be negative:\n e.g. -123 has signed digits -1, 2, and 3.\n >>> count_nums([]) == 0\n >>> count_nums([-1, 11, -11]) == 1\n >>> count_nums([1, 1, 2]) == 3\n \"\"\"\n", "solution": "def count_nums(arr):\n count = 0\n for num in arr:\n if num == 0:\n continue\n sign = 1 if num >= 0 else -1\n digits = str(abs(num))\n total = int(digits[0]) + sum(int(d) for d in digits[1:])\n if total > 0:\n count += 1\n return count", "passes": false, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
488
|
+
{"id": "code-verifier/487", "task_id": "HumanEval/62", "entry_point": "derivative", "prompt": "\n\ndef derivative(xs: list):\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\n", "solution": "def derivative(xs):\n return [xs[i] * i for i in range(1, len(xs))]", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
489
|
+
{"id": "code-verifier/488", "task_id": "HumanEval/133", "entry_point": "sum_squares", "prompt": "\n\ndef sum_squares(lst):\n \"\"\"You are given a list of numbers.\n You need to return the sum of squared numbers in the given list,\n round each element in the list to the upper int(Ceiling) first.\n Examples:\n For lst = [1,2,3] the output should be 14\n For lst = [1,4,9] the output should be 98\n For lst = [1,3,5,7] the output should be 84\n For lst = [1.4,4.2,0] the output should be 29\n For lst = [-2.4,1,1] the output should be 6\n \n\n \"\"\"\n", "solution": "def sum_squares(lst):\n return sum(math.ceil(x) ** 2 for x in lst)", "passes": false, "model": "lfm2.5-2.6b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
490
|
+
{"id": "code-verifier/489", "task_id": "HumanEval/37", "entry_point": "sort_even", "prompt": "\n\ndef sort_even(l: list):\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1, 2, 3])\n [1, 2, 3]\n >>> sort_even([5, 6, 3, 4])\n [3, 6, 5, 4]\n \"\"\"\n", "solution": "\n\ndef sort_even(l: list):\n \"\"\"This function takes a list l and returns a list l' such that\n l' is identical to l in the odd indicies, while its values at the even indicies are equal\n to the values of the even indicies of l, but sorted.\n >>> sort_even([1, 2, 3])\n [1, 2, 3]\n >>> sort_even([5, 6, 3, 4])\n [3, 6, 5, 4]\n \"\"\"\n result = []\n for i in range(len(l)):\n if i % 2 == 0:\n # Even index: take the value from the original list at that index\n result.append(l[i])\n else:\n # Odd index: take the value from the original list at that index\n result.append(l[i])\n\n # Extract values at even indices\n even_indexed_values = [l[i] for i in range(0, len(l), 2)]\n\n # Sort the values at even indices\n sorted_even_values = sorted(even_indexed_values)\n\n # Reconstruct the list\n new_l = list(l)\n for i in range(0, len(l), 2):\n new_l[i] = sorted_even_values[i // 2]\n\n # The requirement is:\n # l' is identical to l in the odd indices.\n # l' values at even indices are the sorted values of the original even indices.\n\n # Let's re-implement based on the description:\n # 1. Odd indices remain the same.\n # 2. Even indices get the sorted values of the original even indices.\n\n odd_elements = [l[i] for i in range(1, len(l), 2)]\n even_elements = [l[i] for i in range(0, len(l), 2)]\n sorted_even_elements = sorted(even_elements)\n\n l_prime = []\n even_idx_counter = 0\n for i in range(len(l)):\n if i % 2 == 0:\n # Even index: use the next sorted even element\n l_prime.append(sorted_even_elements[even_idx_counter])\n even_idx_counter += 1\n else:\n # Odd index: keep the original value\n l_prime.append(l[i])\n\n return l_prime", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
491
|
+
{"id": "code-verifier/490", "task_id": "HumanEval/118", "entry_point": "get_closest_vowel", "prompt": "\ndef get_closest_vowel(word):\n \"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n get_closest_vowel(\"yogurt\") ==> \"u\"\n get_closest_vowel(\"FULL\") ==> \"U\"\n get_closest_vowel(\"quick\") ==> \"\"\n get_closest_vowel(\"ab\") ==> \"\"\n \"\"\"\n", "solution": "def get_closest_vowel(word):\n vowels = \"aeiouAEIOU\"\n n = len(word)\n for i in range(n - 1):\n if word[i] in vowels and word[i + 1] in vowels:\n return word[i]\n return \"\"", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
492
|
+
{"id": "code-verifier/491", "task_id": "HumanEval/47", "entry_point": "median", "prompt": "\n\ndef median(l: list):\n \"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\n", "solution": "\n\ndef median(l: list):\n \"\"\"Return median of elements in the list l.\n >>> median([3, 1, 2, 4, 5])\n 3\n >>> median([-10, 4, 6, 1000, 10, 20])\n 15.0\n \"\"\"\n l.sort()\n n = len(l)\n if n % 2 == 1:\n return l[n // 2]\n else:\n return (l[n // 2 - 1] + l[n // 2]) / 2.0", "passes": true, "model": "gemma4-e2b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
493
|
+
{"id": "code-verifier/492", "task_id": "HumanEval/22", "entry_point": "filter_integers", "prompt": "from typing import List, Any\n\n\ndef filter_integers(values: List[Any]) -> List[int]:\n \"\"\" Filter given list of any python values only for integers\n >>> filter_integers(['a', 3.14, 5])\n [5]\n >>> filter_integers([1, 2, 3, 'abc', {}, []])\n [1, 2, 3]\n \"\"\"\n", "solution": "from typing import List, Any\n\ndef filter_integers(values: List[Any]) -> List[int]:\n return [x for x in values if isinstance(x, int)]", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
494
|
+
{"id": "code-verifier/493", "task_id": "HumanEval/135", "entry_point": "can_arrange", "prompt": "\ndef can_arrange(arr):\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \"\"\"\n", "solution": "\ndef can_arrange(arr):\n \"\"\"Create a function which returns the largest index of an element which\n is not greater than or equal to the element immediately preceding it. If\n no such element exists then return -1. The given array will not contain\n duplicate values.\n\n Examples:\n can_arrange([1,2,4,3,5]) = 3\n can_arrange([1,2,3]) = -1\n \"\"\"\n for i in range(len(arr)-1, 0, -1):\n if arr[i] <= arr[i-1]:\n return i\n return -1", "passes": true, "model": "lfm2.5-8b-a1b-control", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
495
|
+
{"id": "code-verifier/494", "task_id": "HumanEval/1", "entry_point": "separate_paren_groups", "prompt": "from typing import List\n\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n", "solution": "from typing import List\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n s = ''.join(paren_string.split())\n result = []\n stack = []\n current = ''\n for ch in s:\n if ch == '(':\n stack.append(current)\n current = ''\n elif ch == ')':\n stack.pop()\n current += '(' + current + ')'\n else:\n current += ch\n if stack:\n result.append(stack.pop())\n result.append(current)\n return result", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
496
|
+
{"id": "code-verifier/495", "task_id": "HumanEval/102", "entry_point": "choose_num", "prompt": "\ndef choose_num(x, y):\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n", "solution": "\ndef choose_num(x, y):\n \"\"\"This function takes two positive numbers x and y and returns the\n biggest even integer number that is in the range [x, y] inclusive. If \n there's no such number, then the function should return -1.\n\n For example:\n choose_num(12, 15) = 14\n choose_num(13, 12) = -1\n \"\"\"\n if x > y:\n return -1\n import math\n max_int = math.floor(y)\n if max_int % 2 != 0:\n max_int -= 1\n min_even = math.ceil(x)\n if max_int < min_even:\n return -1\n return max_int", "passes": true, "model": "minicpm5-2b-q4-bench-rp", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
497
|
+
{"id": "code-verifier/496", "task_id": "HumanEval/77", "entry_point": "iscube", "prompt": "\ndef iscube(a):\n '''\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n iscube(1) ==> True\n iscube(2) ==> False\n iscube(-1) ==> True\n iscube(64) ==> True\n iscube(0) ==> True\n iscube(180) ==> False\n '''\n", "solution": "\ndef iscube(a):\n '''\n Write a function that takes an integer a and returns True \n if this ingeger is a cube of some integer number.\n Note: you may assume the input is always valid.\n Examples:\n iscube(1) ==> True\n iscube(2) ==> False\n iscube(-1) ==> True\n iscube(64) ==> True\n iscube(0) ==> True\n iscube(180) ==> False\n '''\n if a == 0:\n return True\n root = round(a**(1/3))\n return root * root * root == a", "passes": false, "model": "gemma4-e4b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
498
|
+
{"id": "code-verifier/497", "task_id": "HumanEval/1", "entry_point": "separate_paren_groups", "prompt": "from typing import List\n\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n separate those group into separate strings and return the list of those.\n Separate groups are balanced (each open brace is properly closed) and not nested within each other\n Ignore any spaces in the input string.\n >>> separate_paren_groups('( ) (( )) (( )( ))')\n ['()', '(())', '(()())']\n \"\"\"\n", "solution": "from typing import List\n\ndef separate_paren_groups(paren_string: str) -> List[str]:\n result = []\n current = []\n depth = 0\n for char in paren_string:\n if char == ' ':\n continue\n if char == '(':\n depth += 1\n current.append(char)\n elif char == ')':\n depth -= 1\n current.append(char)\n if depth == 0:\n result.append(''.join(current))\n current = []\n return result", "passes": true, "model": "qwen3.8-27b-mtp-medium", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
499
|
+
{"id": "code-verifier/498", "task_id": "HumanEval/62", "entry_point": "derivative", "prompt": "\n\ndef derivative(xs: list):\n \"\"\" xs represent coefficients of a polynomial.\n xs[0] + xs[1] * x + xs[2] * x^2 + ....\n Return derivative of this polynomial in the same form.\n >>> derivative([3, 1, 2, 4, 5])\n [1, 4, 12, 20]\n >>> derivative([1, 2, 3])\n [2, 6]\n \"\"\"\n", "solution": "def derivative(xs: list):\n if len(xs) <= 1:\n return []\n return [xs[i] * (i + 1) for i in range(len(xs) - 1)]", "passes": false, "model": "granite4.2-3b", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|
|
500
|
+
{"id": "code-verifier/499", "task_id": "HumanEval/118", "entry_point": "get_closest_vowel", "prompt": "\ndef get_closest_vowel(word):\n \"\"\"You are given a word. Your task is to find the closest vowel that stands between \n two consonants from the right side of the word (case sensitive).\n \n Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n find any vowel met the above condition. \n\n You may assume that the given string contains English letter only.\n\n Example:\n get_closest_vowel(\"yogurt\") ==> \"u\"\n get_closest_vowel(\"FULL\") ==> \"U\"\n get_closest_vowel(\"quick\") ==> \"\"\n get_closest_vowel(\"ab\") ==> \"\"\n \"\"\"\n", "solution": "def get_closest_vowel(word):\n vowels = 'aeiouAEIOU'\n for i in range(len(word) - 2, 0, -1):\n if word[i] in vowels and word[i-1] not in vowels and word[i+1] not in vowels:\n return word[i]\n return \"\"", "passes": true, "model": "qwen3.8-27b-mtp-medium", "version": "v1", "evaluator": "evalplus==0.3.1 base+plus, fast_check"}
|