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.
Counting Road Networks
Counting Road Networks
Sort by
recency
|
8 Discussions
|
Please Login in order to post a comment
No gmp function available for PHP to solve this problem Hackerrank should enable gmp and BCMath functions on their servers
Here is my solution in java, C++ HackerRank Counting Road Networks Solution
Here is Counting road Networks problem solution - https://programs.programmingoneonone.com/2021/07/hackerrank-counting-road-networks-problem-solution.html
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
public class E2 { InputStream is; PrintWriter out; String INPUT = "";
// f = sub(f, mul(sub(ii, p, 2*i), f, 2*i)); } return f; }
// r[i+j-(m-1)] = modh(r[i+j-(m-1)]+(long)mod*mod - b[j]*x, MM, HH, mod); } } return new long[][]{q, Arrays.copyOf(r, m-1)}; }
// r[i+j-(m-1)] = modh(r[i+j-(m-1)]+(long)mod*mod - b[j]*x, MM, HH, mod); } } return Arrays.copyOf(r, m-1); }
// public static final int[] NTTPrimes = {1012924417, 1004535809, 998244353, 985661441, 975175681, 962592769, 950009857, 943718401, 935329793, 924844033}; // public static final int[] NTTPrimitiveRoots = {5, 3, 3, 3, 17, 7, 7, 7, 3, 5};
// long Q = (u&(1L<<32)-1)*J&(1L<<32)-1; long Q = (u<<32)*J>>>32; dst[t] = (u>>>32)-(Q*P>>>32)+P; } } if(i < h-1){ for(int k = 0;k < 1<= P)dst[i] -= P; } for(int i = 0;i < n;i++){ int rev = Integer.reverse(i)>>>-h; if(i < rev){ long d = dst[i]; dst[i] = dst[rev]; dst[rev] = d; } }
}
maaa chudalo mujhse ni hora