Mbpp/96

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度394 字符
模型生成的代码 (394 字符)
def divisor(n: int) -> int:
    """
    Return the number of positive divisors of the given integer n (n > 0).
    """
    if n <= 0:
        raise ValueError("Input must be a positive integer")
    count = 0
    i = 1
    while i * i <= n:
        if n % i == 0:
            if i * i == n:
                count += 1
            else:
                count += 2
        i += 1
    return count
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试