题解 | B=A×A

B=A×A

https://www.nowcoder.com/practice/21132ecf432b45a5a8187ea074a5d71e

import sys
import math
def main():
    input=sys.stdin.read().split()
    t=int(input[0])
    for i in range(1,t+1):
        b=int(input[i])
        sqrt_b=int(math.sqrt(b))
        while(sqrt_b+1)**2<=b:
            sqrt_b+=1
        while sqrt_b **2>b:
            sqrt_b-=1
        print(sqrt_b)
main()

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务