Mbpp/589

⚠️ 仅 Base 通过 Base: PASS Plus: FAIL
测试评估
指标结果
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]