提交时间:2023-11-11 11:13:21

运行 ID: 109845

#include<bits/stdc++.h> using namespace std; long long a,b; long long sum(long long a,long long b){ if(b==1) return a; if(b==0) return 1; if(b%2==1){ int p=sum(a,b/2); return p*p*a; } int p=sum(a,b/2); return p*p; } int main(){ cin>>a>>b; cout<<sum(a,b); return 0; }