80分,第三个时间超时
查看原帖
80分,第三个时间超时
523508
邪剑仙楼主2021/8/15 12:20

n=int(input()) t=n ls=[] if n==1: print(1) while n!=1: if n%2!=0: n=n*3+1 ls.append(n) else: n=n/2 ls.append(n) l=len(ls) for i in range(l-1,0,-1): print("{:.0f}".format(ls[i]),end=" ") print("{:.0f} {:.0f}".format(ls[0],t),end=" ")

2021/8/15 12:20
加载中...