You are viewing a single comment's thread. Return to all comments →
static BigInteger solve(int n1, int k1, int n2, int k2, int n) { String s1 = String.valueOf(n1); String s2 = String.valueOf(n2); String s3 = String.valueOf(n); BigInteger b1, b2, b3; b1 = new BigInteger(s1); b2 = new BigInteger(s2); b3 = new BigInteger(s3); b1 = b1.pow(k1); b2 = b2.pow(k2); int i = b2.intValue(); BigInteger result = b1.pow(i); result = result.mod(b3); return result; }
Seems like cookies are disabled on this browser, please enable them to open this website
Devu Vs Police
You are viewing a single comment's thread. Return to all comments →
static BigInteger solve(int n1, int k1, int n2, int k2, int n) { String s1 = String.valueOf(n1); String s2 = String.valueOf(n2); String s3 = String.valueOf(n); BigInteger b1, b2, b3; b1 = new BigInteger(s1); b2 = new BigInteger(s2); b3 = new BigInteger(s3); b1 = b1.pow(k1); b2 = b2.pow(k2); int i = b2.intValue(); BigInteger result = b1.pow(i); result = result.mod(b3); return result; }