标签:code 高精度 bzoj div bsp .com c代码 style zoj
python是坠吼的!
原题:
不贴原题,就是高精度开根,结果向下取整
首先二分答案,高精度嘛……python即可
二分右端点设为n会T掉,需要先倍增一个r,while(r **m <= n) r *= 2
然后T掉了,代码如下,亮点自寻
1 m, n = input(), input() 2 l, r = 0, n 3 while r ** m < n: 4 r *= 2 5 6 while(l + 1 < r): 7 md = (l + r) >> 1 8 if(md ** m <= n): 9 l = md 10 else: 11 r = md 12 13 if(r **m <= n): 14 l = r 15 16 print l
AC代码:
1 m, n = input(), input() 2 l, r = 0, 1 3 while r ** m < n: 4 r *= 2 5 6 while(l + 1 < r): 7 md = (l + r) >> 1 8 if(md ** m <= n): 9 l = md 10 else: 11 r = md 12 13 if(r **m <= n): 14 l = r 15 16 print l
发现了没
标签:code 高精度 bzoj div bsp .com c代码 style zoj
原文地址:http://www.cnblogs.com/JSL2018/p/6485925.html