Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.math.BigInteger;
- public class Reminder {
- public int reminder(int a, int n, int b) {
- BigInteger s = BigInteger.valueOf(a);
- BigInteger o = s.modPow(BigInteger.valueOf(n), BigInteger.valueOf(b));
- int r = o.intValue();
- return r;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement