测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 350 字符 |
模型生成的代码 (350 字符)
import math
def is_perfect_square(n: int) -> bool:
"""
Check whether the given number is a perfect square or not.
Args:
n (int): The number to check.
Returns:
bool: True if n is a perfect square, False otherwise.
"""
if n < 0:
return False
root = math.isqrt(n)
return root * root == n
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试