提交时间:2023-11-11 11:01:53

运行 ID: 109829

#include<iostream> using namespace std; typedef long long ll; ll a, b; ll pow(ll a, ll b){ if(b == 1) return a; if(b == 0) return 1; if(b % 2 == 1) {int t = pow(a, b / 2); return t * t * a;}; int t = pow(a, b / 2); return t * t; } int main(){ cin >> a >> b; cout << pow(a, b); return 0; }