Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ll power(ll a, ll b) {
- ll res = 1;
- while(b) {
- if(b % 2 == 1) {
- res *= a;
- }
- a *= a;
- b /= 2;
- }
- return res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement