2022 ICPC Asia Taiwan Online Programming Contest
H. Heximal
不会高精度,拿python写的,但是python3.8会TLE,python2不会,就是有点卡
高精度+快速幂
def fp(x, y):
ret = 1
while y:
if y % 2 == 1:
ret = ret * x
x = x * x
y = y // 2
return ret
s = int(input())
lll = 1
r = 1000000
ans = r
while lll <= r:
mid = (lll + r) // 2
t = fp(6, mid)
if t > s:
r = mid - 1
ans = min(mid, ans)
else:
lll = mid + 1
print(ans)
标签:11,06,Contest,ans,mid,ret,2022,lll
From: https://www.cnblogs.com/ShG-V/p/16876407.html