답안 #19373

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
19373 2016-02-24T10:51:07 Z camille Α (kriii4_P1) C++
0 / 100
298 ms 1716 KB
#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;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 298 ms 1716 KB Program hung waiting for input
2 Halted 0 ms 0 KB -