제출 #19380

#제출 시각아이디문제언어결과실행 시간메모리
19380camilleΑ (kriii4_P1)C++98
100 / 100
0 ms1716 KiB
#include <iostream> using namespace std; typedef long long lld; lld a,x,mod=1e9+7; lld foo(lld idx){ if(idx==1) return a; lld k = foo(idx/2)%mod; if(idx%2) return (((k*k)%mod)*a)%mod; return (k*k)%mod; } int main(){ cin>>a>>x; a%=mod; cout<<foo(x)<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...