我在IDE中得到了正确的答案,但在线评判给出了以下错误:
Traceback (most recent call last):
File "/tmp/editor_trsource_1410281976_804149.py", line 10, in
n=int(raw_input(''))
ValueError: invalid literal for int() with base 10: '100 10'
Run Code Online (Sandbox Code Playgroud)
问题链接: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
Run Code Online (Sandbox Code Playgroud) python ×1