Submission #19373

#TimeUsernameProblemLanguageResultExecution timeMemory
19373camilleΑ (kriii4_P1)C++98
0 / 100
298 ms1716 KiB
#include <iostream> using namespace std; typedef long long lld; lld a,x,mod=1e9+7; lld foo(lld idx){ cout<<idx<<endl; if(idx==1) return a; if(idx%2) return foo(idx/2)*foo(idx/2)*a%mod; return foo(idx/2)*foo(idx/2)%mod; } int main(){ cin>>a>>x; a%=mod; cout<<foo(x)<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...