测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 583 字符 |
模型生成的代码 (583 字符)
def count_Primes_nums(n):
"""
Returns the number of prime numbers less than the given non-negative number n.
Args:
n (int): A non-negative integer.
Returns:
int: The count of prime numbers less than n.
"""
if n < 2:
return 0
# Sieve of Eratosthenes up to n-1
is_prime = [True] * n
is_prime[0] = is_prime[1] = False
for i in range(2, int(n ** 0.5) + 1):
if is_prime[i]:
for j in range(i * i, n, i):
is_prime[j] = False
return sum(is_prime)
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试