Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int bigmod(long long a,long long p)
- {
- long long ret = 1;
- while(p) {
- if(p & 1) ret = ret * a % mod;
- a = a * a % mod;
- p >>= 1;
- }
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement