51Nod1166 大数开平方

Problem

给出一个大整数N,求不大于N的平方根的最大整数。例如:N = 8,2 * 2 < 8,3 * 3 > 8,所以输出2。

Solution

Code

from math import *
from decimal import *
getcontext().prec=10**5
a=input()
print(int(Decimal(a).sqrt()))
原文地址:https://www.cnblogs.com/sz-wcc/p/11704776.html