萌新求助 python
查看原帖
萌新求助 python
357851
狛枝风斗楼主2020/7/26 15:46

这题用 C++ 打了一遍,明显会爆掉
然后不想打 C++ 高精了,就打了个 python

import fractions
import math

a = int(input())
b = int(input())

c = math.pow(b + 1, a - 1) * (k - n + 1)
d = math.pow(b, a)

e = fractions.gcd(c, d)

print(c / e)
print(" ")
print(d / e)

然后 RE 了 qwq
求纠错 qwq

2020/7/26 15:46
加载中...