We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #15: Lattice paths
Project Euler #15: Lattice paths
Sort by
recency
|
120 Discussions
|
Please Login in order to post a comment
for C#
using System;
class Program { const int MOD = 1000000007;
}
passed all test cases
for a0 in range(int(input())): n, m =list(map(int, input().split())) print(seen[(n, m)])****
My Solution in Java given below:- import java.util.; import java.math.; public class Solution {
BigInteger path = fact(BigInteger.valueOf(N+M)) .divide(fact(BigInteger.valueOf(N))) .divide(fact(BigInteger.valueOf(M))) .mod((BigInteger.valueOf(1000000007))); System.out.println(path.toString());
static BigInteger fact(BigInteger num) { if (num == BigInteger.ZERO) return BigInteger.ONE;
}