测试评估
| 指标 | 结果 |
|---|---|
| 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 失败测试用例
- 无失败测试