Untitled
raw download clone
TEXT
views 17
,
size 380 b
#include<stdio.h>
long long int fpw(long long int x, long long int y, long long int m)
{
    if(y==0) return 1%m;
    long long int res = fpw(x, y/2, m);
    res = (res*res)%m;
    if(y%2==1) res = (res*x)%m;
    return res;
}
int main(void)
{
    long long int x, y, m;
    scanf("%lld %lld %lld", &x, &y, &m);
    printf("%lld\n", res(x, y, m));
    return 0;
}
close fullscreen
Login or Register to edit or fork this paste. It's free.