Mbpp/448

❌ 均未通过 Base: FAIL Plus: FAIL
测试评估
指标结果
Base 测试FAIL
Plus 测试FAIL
代码长度434 字符
模型生成的代码 (434 字符)
def cal_sum(n: int) -> int:
    """
    Returns the sum of the first n+1 Perrin numbers (P(0) to P(n) inclusive).

    The Perrin sequence is defined as:
        P(0) = 3
        P(1) = 0
        P(2) = 2
        P(n) = P(n-2) + P(n-3) for n > 2
    """
    if n < 0:
        return 0
    if n == 0:
        return 3
    if n == 1:
        return 3 + 0
    if n == 2:
        return 3 + 0 + 2

    # initial values
    p0, p1, p2 = 3,
Base 失败测试用例
  • [9]
Plus 失败测试用例
  • [-5]