challenge-coding-002
Suite: coding
Finish: stop
Prompt
只输出 Python 代码,不要解释。实现 solve(events: list[str]) -> int。事件格式:"<id> credit <amount>" 增加余额,"<id> debit <amount>" 减少余额,"rev <id>" 撤销此前尚未撤销过的同 id 事件。重复交易 id 只保留第一次,未知撤销忽略。返回最终余额。
Standard Answer / Scoring Expectation
Reference tests:
events = ['a credit 100', 'b debit 40', 'a credit 999', 'rev b', 'c debit 10']
assert solution.solve(events) == 90
events = ['x debit 5', 'rev y', 'rev x', 'rev x', 'z credit 7']
assert solution.solve(events) == 7
Mistake Analysis
Failure type: code_assertion_failure
撤销交易的方向处理错了。代码把 credit 和 debit 都存成正数 amount,撤销时统一执行 `balance -= amount`;撤销 credit 应该减钱,但撤销 debit 应该把扣掉的钱加回来。第一组用例里 `rev b` 应抵消 `b debit 40`,模型反而又减了 40,最终余额从应为 90 变成 10。
Scorer Details
{
"returncode": 1,
"stdout": "",
"stderr": "Traceback (most recent call last):\n File \"/var/folders/x_/4cht1kfj1_j31gdv5w01sgmw0000gn/T/dracobench-code-vva8cljg/test_solution.py\", line 4, in <module>\n assert solution.solve(events) == 90\nAssertionError\n"
}
Output
```python
def solve(events: list[str]) -> int:
balance = 0
executed = {}
for event in events:
parts = event.split()
if parts[0] == "rev":
eid = parts[1]
if eid in executed and not executed[eid][2]:
_, amount, _ = executed[eid]
balance -= amount
executed[eid][2] = True
else:
eid = parts[0]
if eid in executed:
continue
action = parts[1]
amount = int(parts[2])
if action == "credit":
balance += amount
executed[eid] = [action, amount, False]
elif action == "debit":
balance -= amount
executed[eid] = [action, amount, False]
return balance
```
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-r9ynpf8p/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-r9ynpf8p/solution.py\", line 10, in solve\n key = int(parts[1])\n ^^^^^^^^^^^^^\nValueError: invalid literal for int() with base 10: 'a'\n"
}
Output
```python
def solve(capacity: int, ops: list[str]) -> list[int]:
if capacity == 0:
return [-1 for op in ops if op.startswith("get")]
from collections import OrderedDict
cache = OrderedDict()
res = []
for op in ops:
parts = op.split()
if parts[0] == "put":
key = int(parts[1])
value = int(parts[2])
if key in cache:
cache.move_to_end(key)
else:
if len(cache) == capacity:
cache.popitem(last=False)
cache[key] = value
else: # "get"
key = int(parts[1])
if key in cache:
cache.move_to_end(key)
res.append(cache[key])
else:
res.append(-1)
return res
```
challenge-reasoning-001
Suite: reasoning
Finish: stop
Prompt
只回答最终数字:有 A、B、C、D 四个服务。A 每分钟处理 6 个请求,B 比 A 少 2 个,C 是 B 的 2 倍,D 是 A 和 C 的平均值。四个服务 5 分钟一共处理多少请求?
Standard Answer / Scoring Expectation
Answer: 125
Mistake Analysis
Failure type: answer_mismatch
模型最终答案 `200` 与标准答案 `125` 不一致。正确链路是 A=6,B=4,C=8,D=(6+8)/2=7;每分钟总量 25,5 分钟总量 125。模型输出 `200`,说明它在多步算术链路中把某个服务速率或总时长重复计入了。
Scorer Details
{
"expected": "125",
"actual": "200"
}
Output
200
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: answer_mismatch
模型最终答案 `C` 与标准答案 `D` 不一致。字典序最小的合法队列是 `A B D C E`:A<B<C,E 紧跟 C,且 D 不在两端。第三个任务应为 D,模型输出 `C`,根因是约束排序时没有把 D 的位置限制和字典序最小同时满足。
Scorer Details
{
"expected": "D",
"actual": "C"
}
Output
C
challenge-rag-001
Suite: rag_long_context
Finish: stop
Prompt
只根据资料回答。
资料 A:DracoBench v0.2 的目标是提高区分度,优先增加 coding、debugging、RAG 和 instruction_following 题。
资料 B:DracoBench v0.2 不会默认使用 LLM-as-judge;开放中文写作题只做少量规则校验和人工抽检。
资料 C:v0.2 的 HTML 报告必须展示通过率、成本、reasoning tokens、失败样例和逐题明细。
问题:v0.2 为什么没有把 LLM-as-judge 作为默认判分?
Standard Answer / Scoring Expectation
Required phrases: 人工抽检
At least one from each group: 默认使用 / 默认判分 / 默认采用 / 作为默认判分
Forbidden phrases: 因为成本太高、因为不支持中文
Length guidance (diagnostic only): min=n/a, max=160
Mistake Analysis
Failure type: missing_required_info
问题问的是“为什么 v0.2 不把 LLM-as-judge 作为默认判分”。资料 B 给出的关键依据是:开放中文写作题只做少量规则校验和人工抽检。模型回答 `根据资料 B,v0.2 不会默认使用 LLM-as-judge。` 只是复述“不会默认使用”或说资料未说明,没有说出替代判分方式里的“人工抽检”,因此缺少真正解释原因的证据链。
Scorer Details
{
"missing": [
"人工抽检"
],
"missing_any": [],
"present_forbidden": [],
"char_count": 32,
"length_ok": true,
"length_scored": false
}
Output
根据资料 B,v0.2 不会默认使用 LLM-as-judge。
challenge-reasoning-011
Suite: reasoning
Finish: stop
Prompt
只回答最终数字:列表 [2,4,6,8] 中每个数先减去它的位置编号(从 1 开始),然后删除所有奇数,再把剩余数平方,最后求和。结果是多少?
Standard Answer / Scoring Expectation
Answer: 20
Mistake Analysis
Failure type: answer_mismatch
模型最终答案 `36` 与标准答案 `20` 不一致。列表按位置相减得到 `[1,2,3,4]`,删除奇数后是 `[2,4]`,平方求和为 4+16=20。模型输出 `36`,根因是状态变换顺序或“删除奇数”步骤处理错。
Scorer Details
{
"expected": "20",
"actual": "36"
}
Output
36
challenge-reasoning-013
Suite: reasoning
Finish: stop
Prompt
只回答一个字母:模型 A 通过 18 题、成本 0.06;模型 B 通过 20 题、成本 0.10;模型 C 通过 16 题、成本 0.04。按“通过题数/成本”最高选择,应该选哪个模型?
Standard Answer / Scoring Expectation
Answer: C
Mistake Analysis
Failure type: answer_mismatch
模型最终答案 `B` 与标准答案 `C` 不一致。通过题数/成本分别为 A=18/0.06=300,B=20/0.10=200,C=16/0.04=400。最高是 C,模型输出 `B`,说明它更看重通过题数绝对值,而没有按题目要求计算性价比。
Scorer Details
{
"expected": "C",
"actual": "B"
}
Output
B
challenge-reasoning-017
Suite: reasoning
Finish: stop
Prompt
只回答最终数字:依赖关系为 a 无依赖;b 依赖 a;c 依赖 a;d 依赖 b 和 c;e 依赖 b;f 依赖 d 和 e;g 依赖 a。按可并行执行的拓扑层划分,第二层有几个任务?
Standard Answer / Scoring Expectation
Answer: 3
Mistake Analysis
Failure type: answer_mismatch
模型最终答案 `2` 与标准答案 `3` 不一致。拓扑层应为第一层 `{a}`,第二层 `{b,c,g}`,因为 b、c、g 都只依赖 a。第二层有 3 个任务,模型输出 `2`,通常是漏掉了同样只依赖 a 的 `g`。
Scorer Details
{
"expected": "3",
"actual": "2"
}
Output
2
challenge-reasoning-022
Suite: reasoning
Finish: stop
Prompt
只回答最终数字:映射初始为 {a:1, b:2}。依次执行:设置 c=a+b;设置 a=c-b;删除 b;设置 d=a+c。最终所有 value 之和是多少?
Standard Answer / Scoring Expectation
Answer: 8
Mistake Analysis
Failure type: answer_mismatch
模型最终答案 `6` 与标准答案 `8` 不一致。映射更新后 c=3,a=c-b=1,删除 b,再设置 d=a+c=4;最终 value 为 1、3、4,总和 8。模型输出 `6`,说明它漏做了删除 b、错误更新 a,或没有按顺序使用最新映射值。
Scorer Details
{
"expected": "8",
"actual": "6"
}
Output
6
challenge-coding-018
Suite: coding
Finish: stop
Prompt
只输出 Python 代码,不要解释。实现 solve(path: str) -> str,规范化绝对 Unix 路径:处理重复斜杠、.、..;.. 在根目录时仍留在根目录;返回结果必须以 / 开头且除根目录外不能以 / 结尾。不要使用 os.path。
Standard Answer / Scoring Expectation
Reference tests:
assert solution.solve('/a//b/./c/../') == '/a/b'
assert solution.solve('/../../x') == '/x'
assert solution.solve('/') == '/'
Mistake Analysis
Failure type: code_assertion_failure
路径规范化的主体逻辑基本正确,但根目录边界处理错了。`'/' + '/'.join([])` 得到 `/` 后,代码又执行 `result.rstrip('/')`,把根目录唯一的斜杠也删掉,导致 `solve('/')` 返回空字符串而不是 `/`。
Scorer Details
{
"returncode": 1,
"stdout": "",
"stderr": "Traceback (most recent call last):\n File \"/var/folders/x_/4cht1kfj1_j31gdv5w01sgmw0000gn/T/dracobench-code-pidypxj2/test_solution.py\", line 5, in <module>\n assert solution.solve('/') == '/'\nAssertionError\n"
}
Output
```python
def solve(path: str) -> str:
parts = path.split('/')
stack = []
for part in parts:
if part == '' or part == '.':
continue
if part == '..':
if stack:
stack.pop()
else:
stack.append(part)
result = '/' + '/'.join(stack)
return result if result != '/' else result.rstrip('/')
```
challenge-coding-026
Suite: coding
Finish: stop
Prompt
只输出 Python 代码,不要解释。实现 solve(nums: list[int], k: int) -> list[float],返回每个长度为 k 的滑动窗口中位数。k 为奇数时返回中间值;k 为偶数时返回两个中间值平均数。
Standard Answer / Scoring Expectation
Reference tests:
assert solution.solve([1,3,-1,-3,5,3,6,7], 3) == [1, -1, -1, 3, 5, 6]
assert solution.solve([1,2,3,4], 2) == [1.5, 2.5, 3.5]
Mistake Analysis
Failure type: code_assertion_failure
双堆思路方向正确,但懒删除实现没有维护两个堆的“有效元素数量”。窗口滑动时旧元素只记在 `to_remove`,堆的物理长度仍参与 `balance()`,导致堆大小和真实窗口分布不同步;后半段窗口的中位数被旧元素/错误堆顶影响,第一组期望 `[1,-1,-1,3,5,6]`,模型给出后几项偏小。
Scorer Details
{
"returncode": 1,
"stdout": "",
"stderr": "Traceback (most recent call last):\n File \"/var/folders/x_/4cht1kfj1_j31gdv5w01sgmw0000gn/T/dracobench-code-4wjvgkqf/test_solution.py\", line 3, in <module>\n assert solution.solve([1,3,-1,-3,5,3,6,7], 3) == [1, -1, -1, 3, 5, 6]\nAssertionError\n"
}
Output
```python
from heapq import heappush, heappop
from collections import Counter
from typing import List
def solve(nums: List[int], k: int) -> List[float]:
n = len(nums)
if k == 0 or n == 0:
return []
res = []
to_remove = Counter()
small = [] # 最大堆(存负数)
large = [] # 最小堆
def clean(heap, is_small):
while heap:
val = -heap[0] if is_small else heap[0]
if to_remove[val] > 0:
to_remove[val] -= 1
heappop(heap)
else:
break
def balance():
# 调整使得 len(small) >= len(large) 且相差不超过1
while len(small) > len(large) + 1:
heappush(large, -heappop(small))
while len(large) > len(small):
heappush(small, -heappop(large))
def get_median():
clean(small, True)
clean(large, False)
if k % 2 == 1:
return float(-small[0])
else:
return (-small[0] + large[0]) / 2.0
# 初始窗口
for i in range(k):
heappush(small, -nums[i])
if large and -small[0] > large[0]:
top_small = -heappop(small)
top_large = heappop(large)
heappush(small, -top_large)
heappush(large, top_small)
if len(small) > len(large) + 1:
heappush(large, -heappop(small))
elif len(large) > len(small):
heappush(small, -heappop(large))
res.append(get_median())
# 滑动窗口
for i in range(k, n):
left = nums[i - k]
right = nums[i]
to_remove[left] += 1
if not small or right <= -small[0]:
heappush(small, -right)
else:
heappush(large, right)
balance()
clean(small, True)
clean(large, False)
balance()
challenge-rag-009
Suite: rag_long_context
Finish: stop
Prompt
只根据资料回答,不要自行补充。
资料:报告展示 pass_rate、avg_latency_ms、total_cost、reasoning_tokens、失败样例和逐题明细。资料没有包含用户满意度调查,也没有包含模型训练数据来源。
问题:能否根据这份报告判断用户满意度?
Standard Answer / Scoring Expectation
Required phrases: 不能、用户满意度
At least one from each group: 没有包含 / 没有提供 / 资料没有 / 未包含
Forbidden phrases: 可以判断
Length guidance (diagnostic only): min=n/a, max=120
Mistake Analysis
Failure type: missing_required_info
模型结论 `不能。` 方向正确,但回答过短,只给了“不能”而没有说明依据。这类 RAG 题要求同时回答结论和资料中的缺失字段;本题缺少 `用户满意度`,所以读者无法复查模型为什么不能判断。
Scorer Details
{
"missing": [
"用户满意度"
],
"missing_any": [
[
"没有包含",
"没有提供",
"资料没有",
"未包含"
]
],
"present_forbidden": [],
"char_count": 3,
"length_ok": true,
"length_scored": false
}
Output
不能。
challenge-rag-016
Suite: rag_long_context
Finish: stop
Prompt
只根据资料回答。
资料:usage 字段包含 prompt_tokens、completion_tokens、reasoning_tokens 和 cost。报告没有供应商真实利润率,也没有供应商内部成本。
问题:能否从 usage 字段判断供应商利润率?
Standard Answer / Scoring Expectation
Required phrases: 不能、利润率
At least one from each group: 不包含 / 没有
Forbidden phrases: 可以判断
Length guidance (diagnostic only): min=n/a, max=120
Mistake Analysis
Failure type: missing_required_info
模型结论 `不能。` 方向正确,但回答过短,只给了“不能”而没有说明依据。这类 RAG 题要求同时回答结论和资料中的缺失字段;本题缺少 `利润率`,所以读者无法复查模型为什么不能判断。
Scorer Details
{
"missing": [
"利润率"
],
"missing_any": [
[
"不包含",
"没有"
]
],
"present_forbidden": [],
"char_count": 3,
"length_ok": true,
"length_scored": false
}
Output
不能。