Mbpp/803

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
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 失败测试用例
  • 无失败测试