제출 #19590

#제출 시각아이디문제언어결과실행 시간메모리
19590pjh0123Α (kriii4_P1)C++98
100 / 100
0 ms1084 KiB
#include <stdio.h>
#include <string.h>
#include <vector>
#include <queue>
#include <stdlib.h>
#include <algorithm>
#include <cmath>
#define INFL 90000000000000000
#define PI 3.141592653589793238462643383279502884
#define SQ(a) ((a)*(a))
#define pb push_back
#define mod 1000000007
typedef long long ll;
typedef long double ld;
typedef double dd;
typedef std::pair<int,int> pii;
using namespace std;

ll a,x;

ll mpx(ll a,ll x){
	a%=mod;
	ll ret=1;
	while(x){
		if(x%2){
			ret=ret*a%mod;
		}
		a=a*a%mod;
		x/=2;
	}
	return ret;
}
int main(){
	scanf("%lld%lld",&a,&x);
	printf("%lld",mpx(a,x));
}
#Verdict Execution timeMemoryGrader output
Fetching results...