wzk2013L @ 2024-11-10 21:52:58
怎么过啊~~~~
by King_and_Grey @ 2024-11-10 21:58:13
@wzk2013 不是,题解。。。
import math#引入math库
a = int(input()) #以整数方式来读入
#lee=len(str(pow(2,a))) len()表示字符串长度,str()表示强制转换为字符串,这样求字符串长度会超时(70')
lee = math.log10(2)*a+1 #求长度
b=pow(2,a,100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) #1后面499个0,注意不要使用1e499,会RE
b = b-1 #对输出结果减1
c ='%0500d' %b #格式化数字补0,转为字符串
a1=int(50)
a2 =int(10)
print(int(lee))
k =int(0)
for j in range(a2):
for i in range(a1):
print(c[k],end='') #对字符串切片输出
k=k+1
print(" ") #换行
by King_and_Grey @ 2024-11-10 21:59:23
@wzk2013 C++要高精度 and 快速幂