1 template<typename T_D, typename T_U> 2 T_D pow(T_D a, T_U b){ 3 T_D ans = 1, base = a; 4 while(b){ 5 if(b % 2 == 1){ 6 ans *= base; 7 } 8 base *= base; 9 b /= 2; 10 } 11 return ans; 12 } 13 14 int main(){ 15 long long a = 8; 16 cout << pow(a, 10); 17 }