Advertisement
nocturnalmk

Reminder

Apr 21st, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. import java.math.BigInteger;
  2.  
  3. public class Reminder {
  4.    
  5.   public int reminder(int a, int n, int b) {
  6.    
  7.       BigInteger s = BigInteger.valueOf(a);
  8.       BigInteger o = s.modPow(BigInteger.valueOf(n), BigInteger.valueOf(b));
  9.      
  10.       int r = o.intValue();
  11.       return r;
  12.      
  13.   }
  14.    
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement