BBP 公式 TLE
查看原帖
BBP 公式 TLE
916579
GoodLuckCat楼主2024/8/20 11:24

学了半个小时 python↑

写出来的↓

n=1000000
t=16**n
s=0
for i in range(n+1000):
    a=(4*t)//(8*i+1)
    b=(2*t)//(8*i+4)
    c=t//(8*i+5)
    d=t//(8*i+6)
    s+=a-b-c-d
    t//=16
x=hex(s)[2:].upper()
m=int(input())
p=input().split()
for i in range(m):
    print(x[int(p[i])],end='')
2024/8/20 11:24
加载中...