messages
listlengths 2
2
| task_id
stringclasses 3
values | passed_tests
int64 0
8
| total_tests
int64 3
10
|
|---|---|---|---|
[
{
"content": "You are a *bug generator* for Python solutions to competitive programming problems.\n\nYou will be given:\n\n1. A problem description.\n2. A *correct* reference implementation in Python.\n\nYour task:\n\n- Introduce **one or a few subtle bugs** into the code.\n- The resulting code **must still be syntactically valid Python**.\n- It should change the behavior so that **at least one unit test fails**.\n- Do **not** drastically rewrite the code; keep the overall structure similar.\n- Do **not** change the function signature, imports, or I/O format.\n- Output **only** the full buggy Python code inside a single ```python``` block.\n\nProblem:\nWrite a function that returns the sum of two numbers.\n\nCorrect reference implementation:\ndef add(a, b):\n return a + b\n\nNow generate the buggy version of this code. Return the entire function with the buggy code inside a ```python``` block:",
"role": "user"
},
{
"content": "```python\ndef add(a, b):\n return a - b # Bug: subtraction instead of addition\n```",
"role": "assistant"
}
] |
test_0
| 0
| 3
|
[
{
"content": "You are a *bug generator* for Python solutions to competitive programming problems.\n\nYou will be given:\n\n1. A problem description.\n2. A *correct* reference implementation in Python.\n\nYour task:\n\n- Introduce **one or a few subtle bugs** into the code.\n- The resulting code **must still be syntactically valid Python**.\n- It should change the behavior so that **at least one unit test fails**.\n- Do **not** drastically rewrite the code; keep the overall structure similar.\n- Do **not** change the function signature, imports, or I/O format.\n- Output **only** the full buggy Python code inside a single ```python``` block.\n\nProblem:\nWrite a function that returns the maximum of a list.\n\nCorrect reference implementation:\ndef find_max(lst):\n if not lst:\n return None\n return max(lst)\n\nNow generate the buggy version of this code. Return the entire function with the buggy code inside a ```python``` block:",
"role": "user"
},
{
"content": "```python\ndef find_max(lst):\n if not lst:\n return None\n return min(lst) # Bug: min instead of max\n```",
"role": "assistant"
}
] |
test_1
| 1
| 5
|
[
{
"content": "You are a *bug generator* for Python solutions to competitive programming problems.\n\nYou will be given:\n\n1. A problem description.\n2. A *correct* reference implementation in Python.\n\nYour task:\n\n- Introduce **one or a few subtle bugs** into the code.\n- The resulting code **must still be syntactically valid Python**.\n- It should change the behavior so that **at least one unit test fails**.\n- Do **not** drastically rewrite the code; keep the overall structure similar.\n- Do **not** change the function signature, imports, or I/O format.\n- Output **only** the full buggy Python code inside a single ```python``` block.\n\nProblem:\nWrite a function that checks if a number is prime.\n\nCorrect reference implementation:\ndef 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\nNow generate the buggy version of this code. Return the entire function with the buggy code inside a ```python``` block:",
"role": "user"
},
{
"content": "```python\ndef is_prime(n):\n if n < 2:\n return False\n for i in range(2, int(n**0.5)): # Bug: missing +1\n if n % i == 0:\n return False\n return True\n```",
"role": "assistant"
}
] |
test_2
| 8
| 10
|
README.md exists but content is empty.
- Downloads last month
- 9