测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | FAIL |
| 代码长度 | 480 字符 |
模型生成的代码 (480 字符)
import math
def perfect_squares(a: int, b: int) -> list[int]:
"""
Returns a list of all perfect squares in the inclusive interval [a, b].
The list is sorted in ascending order.
"""
if a > b:
a, b = b, a
# Find the smallest integer whose square is >= a
start = math.isqrt(a)
if start * start < a:
start += 1
# Find the largest integer whose square is <= b
end = math.isqrt(b)
return [i * i for i in range(start, end + 1)]
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
[-10, -1]