Mbpp/592

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度424 字符
模型生成的代码 (424 字符)
import math
def sum_Of_product(n: int) -> int:
    """
    Returns the sum of the product of consecutive binomial coefficients
    for a given integer n. That is, sum_{k=0}^{n-1} C(n, k) * C(n, k+1).
    This equals C(2n, n-1).
    """
    if n < 0:
        raise ValueError("n must be a non-negative integer")
    # Combinatorial identity: sum_{k=0}^{n-1} C(n, k) * C(n, k+1) = C(2n, n-1)
    return math.comb(2 * n, n - 1)
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试