Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. typedef long long ll;
  5. ll BigMod(ll b,ll p,ll m) {
  6. ll res=1;
  7. while(p) {
  8. if(p&1) {
  9. res=(res*b)%m;
  10. }
  11. p/=2;
  12. b=(b*b)%m;
  13. }
  14. return res;
  15. }
  16. int main() {
  17. cout<<BigMod(2,1000000000,1000000007);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement