Submission #19386

# Submission time Handle Problem Language Result Execution time Memory
19386 2016-02-24T11:07:41 Z kdh9949 Α (kriii4_P1) C++
0 / 100
0 ms 1084 KB
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;

ll a, b;
ll mod = 1000000007;

ll pw(ll x, ll k){
    if(k == 0) return 1;
    if(k == 1) return x;
    ll t = pw(x, k / 2); t *= t; t %= mod;
    if(k % 2) return t * x % mod;
    return t;
}

int main(){
    scanf("%lld%lld", &a, &b);
    printf("%lld\n", pw(a, b));
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1084 KB Output isn't correct
2 Halted 0 ms 0 KB -