NZEC in spoj FACKT
- by frodo
I was trying to solve this problem http://www.spoj.pl/problems/FACKT/, and I keep getting a Non-Zero Exit Code (NZEC). How exactly do I figure out what to change in the code to overcome this?
Here is the code
import math
import sys
def cal_num(n):
i = 1
f = 1
while f<n:
f *= i
i = i + 1
return i-1
while 1:
line = sys.stdin.readline()
if line == "":
break
n = int(line)
x = cal_num(n)
y = math.factorial(2*x)
l = int(math.ceil(math.log(y,10)))
print (x,l)
Any suggestion would be welcome.