Mbpp/20

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