You are viewing a single comment's thread. Return to all comments →
def solve(n, m):
Thank you so much!!
p = p*a
a = a-1
t = int(input())
for i in range(t):
m,n = map(int,input().strip().split())
whats wrong in this code?
use integer divison '//' in place of '/' in 'fact(m+n-1)/(fact(m)*fact(n-1))'
Wow I simply assumed the numbers would get too large for that to work. Python is awesome! I know it automatically resizes ints to longs. I guess it does that for BigInts too. On harder challenges I'd be careful about timeout, but this looks like a much cleaner solution if the judge will run it. Much cleaner than the Python solution I posted!