20分求助啊啊啊,大佬救救我救救我!!!

P1045 [NOIP2003 普及组] 麦森数

lybmnpy @ 2021-04-08 21:59:35

p=eval(input())
a=str(2**p-1)
print(len(a))
ls=[]
k=0
for i in a:
    ls.append(i)    
if len(a)<500:
    for i in range(500-len(a)):
        print(0,end="")
        k+=1
        if k==50:
            print()
            k=0
    for j in ls:
        print(j,end="")
        k+=1
        if k==50:
            print()
            k=0
else:
    for i in range(500):
        print(ls[i],end="")
        k+=1
        if k==50:
            print()
            k=0

by sorrymybad @ 2021-04-09 18:58:22

做你的美梦


|