测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | FAIL |
| Plus 测试 | FAIL |
| 代码长度 | 287 字符 |
模型生成的代码 (287 字符)
def sequence(n: int) -> int:
"""
Returns the nth number in the Newman-Conway sequence.
P(1) = P(2) = 1, P(n) = P(P(n-1)) + P(n - P(n-1)) for n > 2.
"""
if n <= 0:
raise ValueError("n must be a positive integer")
if n == 1 or n == 2:
return 1
#
Base 失败测试用例
[10]
Plus 失败测试用例
[100]