贝壳笔试算法第一题,AC55%,求助大神这个代码问题所在!!
def GetResult(K): a = 0 n = p = 1 while n >= 1: while p >= 1: a = a+ int(math.factorial(n) / p) p = p-1 b = K * math.factorial(n) if a > b: return n else: p = n + 1 a = 0 n =n + 1 _K = int(input()) res = GetResult(_K) print(res, "\n")
#贝壳找房##笔试题目##题解#