challenge-coding-004
Suite: coding
Finish: stop
Prompt
只输出 Python 代码,不要解释。实现 solve(capacity: int, ops: list[str]) -> list[int],模拟 LRU cache。ops 包含 "put key value" 和 "get key"。get 返回 value,不存在返回 -1。put 已存在 key 要更新并变成最近使用。容量为 0 时所有 get 都返回 -1。
Standard Answer / Scoring Expectation
Reference tests:
ops = ['put a 1', 'put b 2', 'get a', 'put c 3', 'get b', 'get a', 'get c']
assert solution.solve(2, ops) == [1, -1, 1, 3]
assert solution.solve(0, ['put a 1', 'get a']) == [-1]
assert solution.solve(1, ['put a 1', 'put a 2', 'get a']) == [2]
Mistake Analysis
Failure type: runtime_type_assumption
题目里的 cache key 是字符串,例如 `a`、`b`、`c`,但模型把 key 强行写成 `int(parts[1])`。测试一遇到 `put a 1` 就在解析 `a` 时抛出 ValueError。根因是模型擅自补了“key 是整数”的类型假设。
Scorer Details
{
"returncode": 1,
"stdout": "",
"stderr": "Traceback (most recent call last):\n File \"/var/folders/x_/4cht1kfj1_j31gdv5w01sgmw0000gn/T/dracobench-code-qips56yi/test_solution.py\", line 4, in <module>\n assert solution.solve(2, ops) == [1, -1, 1, 3]\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/private/var/folders/x_/4cht1kfj1_j31gdv5w01sgmw0000gn/T/dracobench-code-qips56yi/solution.py\", line 20, in solve\n key, value = int(key), int(value)\n ^^^^^^^^\nValueError: invalid literal for int() with base 10: 'a'\n"
}
Output
```python
from collections import OrderedDict
def solve(capacity: int, ops: list[str]) -> list[int]:
if capacity == 0:
return [-1 if op.startswith("get") else 0 for op in ops]
cache = OrderedDict()
res = []
for op in ops:
if op.startswith("get"):
key = int(op.split()[1])
if key in cache:
cache.move_to_end(key)
res.append(cache[key])
else:
res.append(-1)
else:
_, key, value = op.split()
key, value = int(key), int(value)
if key in cache:
cache.move_to_end(key)
elif len(cache) == capacity:
cache.popitem(last=False)
cache[key] = value
res.append(0)
return res
```
challenge-reasoning-002
Suite: reasoning
Finish: stop
Prompt
只回答一个字母:五个任务 A、B、C、D、E 排队。A 必须在 B 前,B 必须在 C 前;D 不能在两端;E 必须紧挨在 C 后面。在所有满足条件的队列中,按字典序最小的队列第三个任务是谁?
Standard Answer / Scoring Expectation
Answer: D
Mistake Analysis
Failure type: format_violation
核心答案可以还原为标准答案 `D`,但模型输出为 `# 求解过程\n\n## 约束条件\n1. A < B < C(位置顺序)\n2. C 后面紧跟 E(CE 是连续块)\n3. D 不能在第1位或第5位\n\n## 排列 CE 块的位置\n\n综合约束 A < B < C < E,链式顺…`,包含 Markdown、解释或其他多余内容。题目要求只输出最终答案,因此严格 exact scorer 判失败。
Scorer Details
{
"expected": "D",
"actual": "# 求解过程\n\n## 约束条件\n1. A < B < C(位置顺序)\n2. C 后面紧跟 E(CE 是连续块)\n3. D 不能在第1位或第5位\n\n## 排列 CE 块的位置\n\n综合约束 A < B < C < E,链式顺序为 **A → B → CE**\n\n| CE 位置 | 可行性 |\n|---------|--------|\n| (1,2) | ❌ B 必须在 C 前,无位置 |\n| (2,3) | ❌ B 在位置1,A 无位置 |\n| (3,4) | ❌ D 必须在位置5(端点),违规 |\n| **(4,5)** | ✅ 见下方分析 |\n\n## CE 在 (4,5) 时枚举\n\n剩余位置 1、2、3 分配给 A、B、D(要求 A < B,D 不在端点):\n\n- A=1, B=2, D=3 → **A, B, D, C, E** ✅\n- A=1, B=3, D=2 → **A, D, B, C, E** ✅\n- A=2, B=3, D=1 → D 在位置1 ❌\n\n## 字典序比较\n\n$$A, \\underline{B}, D, C, E \\quad < \\quad A, \\underline{D}, B, C, E$$\n\n字典序最小的队列为 **A, B, D, C, E**,第三个任务是:\n\n**D**"
}
Output
# 求解过程
## 约束条件
1. A < B < C(位置顺序)
2. C 后面紧跟 E(CE 是连续块)
3. D 不能在第1位或第5位
## 排列 CE 块的位置
综合约束 A < B < C < E,链式顺序为 **A → B → CE**
| CE 位置 | 可行性 |
|---------|--------|
| (1,2) | ❌ B 必须在 C 前,无位置 |
| (2,3) | ❌ B 在位置1,A 无位置 |
| (3,4) | ❌ D 必须在位置5(端点),违规 |
| **(4,5)** | ✅ 见下方分析 |
## CE 在 (4,5) 时枚举
剩余位置 1、2、3 分配给 A、B、D(要求 A < B,D 不在端点):
- A=1, B=2, D=3 → **A, B, D, C, E** ✅
- A=1, B=3, D=2 → **A, D, B, C, E** ✅
- A=2, B=3, D=1 → D 在位置1 ❌
## 字典序比较
$$A, \underline{B}, D, C, E \quad < \quad A, \underline{D}, B, C, E$$
字典序最小的队列为 **A, B, D, C, E**,第三个任务是:
**D**
challenge-reasoning-005
Suite: reasoning
Finish: stop
Prompt
只回答“可满足”或“不可满足”:有三个布尔变量 x、y、z。约束为:x 或 y 为真;如果 x 为真则 z 为假;如果 y 为真则 z 为真;x 和 y 不能同时为真。是否存在赋值满足全部约束?
Standard Answer / Scoring Expectation
Answer: 可满足
Mistake Analysis
Failure type: format_violation
核心答案可以还原为标准答案 `可满足`,但模型输出为 `**可满足**\n\n存在满足全部约束的赋值,例如:\n\n- **x = 真,y = 假,z = 假**(满足约束1:x为真✓;约束2:x为真则z为假✓;约束3:y为假,前提不成立✓;约束4:不同时为真✓)\n\n另一组可行解:x = …`,包含 Markdown、解释或其他多余内容。题目要求只输出最终答案,因此严格 exact scorer 判失败。
Scorer Details
{
"expected": "可满足",
"actual": "**可满足**\n\n存在满足全部约束的赋值,例如:\n\n- **x = 真,y = 假,z = 假**(满足约束1:x为真✓;约束2:x为真则z为假✓;约束3:y为假,前提不成立✓;约束4:不同时为真✓)\n\n另一组可行解:x = 假,y = 真,z = 真。"
}
Output
**可满足**
存在满足全部约束的赋值,例如:
- **x = 真,y = 假,z = 假**(满足约束1:x为真✓;约束2:x为真则z为假✓;约束3:y为假,前提不成立✓;约束4:不同时为真✓)
另一组可行解:x = 假,y = 真,z = 真。
challenge-coding-010
Suite: coding
Finish: stop
Prompt
只输出 Python 代码,不要解释。实现 solve(expr: str) -> int。expr 只包含非负整数、+、-、空格和括号,计算表达式结果。不要使用 eval。
Standard Answer / Scoring Expectation
Reference tests:
assert solution.solve('1 + 2 - 3') == 0
assert solution.solve('10 - (2 + 3) + 4') == 9
assert solution.solve('(1+(4+5+2)-3)+(6+8)') == 23
Mistake Analysis
Failure type: code_assertion_failure
表达式解析器没有在读取运算符前跳过空格。解析完 `1` 后,指针停在空格上,`while expr[i] in '+-'` 直接结束,导致 `1 + 2 - 3` 只返回 1 而不是继续计算到 0。根因是词法扫描对空白字符处理不一致。
Scorer Details
{
"returncode": 1,
"stdout": "",
"stderr": "Traceback (most recent call last):\n File \"/var/folders/x_/4cht1kfj1_j31gdv5w01sgmw0000gn/T/dracobench-code-xoifdp2j/test_solution.py\", line 3, in <module>\n assert solution.solve('1 + 2 - 3') == 0\nAssertionError\n"
}
Output
```python
def solve(expr: str) -> int:
i = 0
def parse_expr():
nonlocal i
result = parse_term()
while i < len(expr) and expr[i] in '+-':
op = expr[i]
i += 1
term = parse_term()
if op == '+':
result += term
else:
result -= term
return result
def parse_term():
nonlocal i
while i < len(expr) and expr[i] == ' ':
i += 1
if i < len(expr) and expr[i] == '(':
i += 1 # skip '('
result = parse_expr()
i += 1 # skip ')'
return result
sign = 1
if i < len(expr) and expr[i] == '-':
sign = -1
i += 1
while i < len(expr) and expr[i] == ' ':
i += 1
num = 0
while i < len(expr) and expr[i].isdigit():
num = num * 10 + int(expr[i])
i += 1
return sign * num
return parse_expr()
```
challenge-reasoning-012
Suite: reasoning
Finish: stop
Prompt
只回答最终数字:一个 5 位二进制数 10110 先循环右移 1 位,再与 00111 做异或,最后转成十进制。结果是多少?
Standard Answer / Scoring Expectation
Answer: 12
Mistake Analysis
Failure type: format_violation
核心答案可以还原为标准答案 `12`,但模型输出为 `**12**\n\n逐步过程:\n1. **循环右移1位**:10110 → **01011**\n2. **与 00111 异或**:01011 ⊕ 00111 = **01100**\n3. **转十进制**:01100₂ = **1…`,包含 Markdown、解释或其他多余内容。题目要求只输出最终答案,因此严格 exact scorer 判失败。
Scorer Details
{
"expected": "12",
"actual": "**12**\n\n逐步过程:\n1. **循环右移1位**:10110 → **01011**\n2. **与 00111 异或**:01011 ⊕ 00111 = **01100**\n3. **转十进制**:01100₂ = **12**"
}
Output
**12**
逐步过程:
1. **循环右移1位**:10110 → **01011**
2. **与 00111 异或**:01011 ⊕ 00111 = **01100**
3. **转十进制**:01100₂ = **12**
challenge-coding-015
Suite: coding
Finish: stop
Prompt
只输出 Python 代码,不要解释。实现 solve(line: str) -> list[str],解析一行简化 CSV:逗号分隔;字段可以用双引号包裹;引号内逗号保留;引号内两个连续双引号表示一个双引号;空字段保留;空格是普通字符,不要自动 trim。
Standard Answer / Scoring Expectation
Reference tests:
assert solution.solve('a,"b,c",d') == ['a', 'b,c', 'd']
assert solution.solve('"a""b",,x') == ['a"b', '', 'x']
assert solution.solve(' a ," b " ') == [' a ', ' b ']
Mistake Analysis
Failure type: code_assertion_failure
CSV 解析在引号字段结束后只接受紧跟逗号,没有把引号后的普通空格作为字段内容保留下来。第三个测试里 `" b " ` 的结束引号后还有一个空格,期望字段是 ` b `;模型输出漏掉了尾随空格,违反了题目“空格是普通字符,不要 trim”的要求。
Scorer Details
{
"returncode": 1,
"stdout": "",
"stderr": "Traceback (most recent call last):\n File \"/var/folders/x_/4cht1kfj1_j31gdv5w01sgmw0000gn/T/dracobench-code-ske8u3eq/test_solution.py\", line 5, in <module>\n assert solution.solve(' a ,\" b \" ') == [' a ', ' b ']\nAssertionError\n"
}
Output
```python
def solve(line: str) -> list[str]:
fields = []
i = 0
n = len(line)
while i <= n:
if i == n or line[i] == ',':
fields.append('')
i += 1
elif line[i] == '"':
i += 1
field = []
while i < n:
if line[i] == '"':
if i + 1 < n and line[i + 1] == '"':
field.append('"')
i += 2
else:
i += 1
break
else:
field.append(line[i])
i += 1
fields.append(''.join(field))
if i < n and line[i] == ',':
i += 1
else:
j = i
while j < n and line[j] != ',':
j += 1
fields.append(line[i:j])
i = j + 1
return fields
```
challenge-coding-027
Suite: coding
Finish: stop
Prompt
只输出 Python 代码,不要解释。实现 solve(versions: list[str]) -> list[str],按简化语义版本排序。版本为 major.minor.patch 或 major.minor.patch-label;major/minor/patch 按数字比较;同一数字版本下,带 label 的预发布版本低于正式版本;label 按字典序比较。
Standard Answer / Scoring Expectation
Reference tests:
assert solution.solve(['1.0.0','1.0.0-alpha','1.0.1','1.0.0-beta','0.9.9']) == ['0.9.9','1.0.0-alpha','1.0.0-beta','1.0.0','1.0.1']
assert solution.solve(['1.0.10','1.0.2']) == ['1.0.2','1.0.10']
Mistake Analysis
Failure type: code_type_error
版本排序 key 的最后一项有时是字符串 label,有时是 `None`。Python 排序比较同一数字版本时会尝试比较 `'alpha'` 和 `None`,直接抛出 TypeError。根因是没有把正式版和预发布版映射到同一类型的可比较 key;应显式让预发布版低于正式版,例如用 `(has_no_label, label)` 这类布尔/字符串组合。
Scorer Details
{
"returncode": 1,
"stdout": "",
"stderr": "Traceback (most recent call last):\n File \"/var/folders/x_/4cht1kfj1_j31gdv5w01sgmw0000gn/T/dracobench-code-7bi9cfye/test_solution.py\", line 3, in <module>\n assert solution.solve(['1.0.0','1.0.0-alpha','1.0.1','1.0.0-beta','0.9.9']) == ['0.9.9','1.0.0-alpha','1.0.0-beta','1.0.0','1.0.1']\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/private/var/folders/x_/4cht1kfj1_j31gdv5w01sgmw0000gn/T/dracobench-code-7bi9cfye/solution.py\", line 7, in solve\n return sorted(versions, key=lambda v: parse_version(v))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nTypeError: '<' not supported between instances of 'str' and 'NoneType'\n"
}
Output
```python
def solve(versions: list[str]) -> list[str]:
def parse_version(v: str):
base, *label = v.split("-", 1)
major, minor, patch = map(int, base.split("."))
return (major, minor, patch, label[0] if label else None)
return sorted(versions, key=lambda v: parse_version(v))
```
challenge-rag-014
Suite: rag_long_context
Finish: stop
Prompt
只根据资料回答。
资料 A:早期 ability mode 使用 4096 max_tokens。
资料 B:后来为了公平,ability mode 统一放宽到 16384 max_tokens。
资料 C:当前总览页只展示 v0.2-challenge50 且 ability16384 的结果。
问题:当前总览页对应的 token limit 是多少?
Standard Answer / Scoring Expectation
Required phrases: 16384
Forbidden phrases: 4096
Length guidance (diagnostic only): min=n/a, max=100
Mistake Analysis
Failure type: empty_output
题目问当前总览页对应的 token limit,资料 B/C 都指向 `ability16384`,应回答 16384。模型返回了空字符串,导致关键数字完全缺失。根因是正常 stop 但未产出正文,不是资料检索歧义。
Scorer Details
{
"missing": [
"16384"
],
"missing_any": [],
"present_forbidden": [],
"char_count": 0,
"length_ok": true,
"length_scored": false
}
Output