Mbpp/20

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度400 字符
模型生成的代码 (400 字符)
def is_woodall(num: int) -> bool:
    """
    Check if a given number is a Woodall number.
    A Woodall number has the form: W_n = n * 2^n - 1 for some positive integer n.
    """
    if num < 1:
        return False
    
    n = 1
    while True:
        woodall = n * (2 ** n) - 1
        if woodall == num:
            return True
        if woodall > num:
            return False
        n += 1
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试