测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 390 字符 |
模型生成的代码 (390 字符)
import math
def is_perfect_square(n: int) -> bool:
"""
Check whether the given integer is a perfect square.
A perfect square is an integer that is the square of an integer.
Negative numbers are not perfect squares.
"""
if n < 0:
return False
# math.isqrt computes the integer floor of the square root
root = math.isqrt(n)
return root * root == n
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试