chang2394

Untitled

Sep 10th, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. LL fast_pow(LL a,LL b){
  2. LL ans = 1;
  3. while(b > 0){
  4. if (b & 1)
  5. ans = (ans * a)%Mod;
  6. a = (a*a)%Mod;
  7. b = b >> 1;
  8. }
  9. return ans;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment