python - Why is there an "Invalid literal error"? -
i getting right answer in ide online judge gives following error:
traceback (most recent call last): file "/tmp/editor_trsource_1410281976_804149.py", line 10, in n=int(raw_input('')) valueerror: invalid literal int() base 10: '100 10' problem link: http://www.hackerearth.com/problem/golf/minimal-combinatorial/
def fact(x): f=1 while x>0: f=f*x x-=1 return f t=int(raw_input('')) while t>0: n=int(raw_input('')) r=int(raw_input('')) ans=fact(n)/(fact(r)*fact(n-r)) print str(ans) + "\n" t-=1
n , r entered on same line.
100 10 your program expects them entered on 2 separate lines.
100 10
Comments
Post a Comment