Pagini recente » Cod sursa (job #1102267) | Cod sursa (job #539466) | Cod sursa (job #2534278) | Cod sursa (job #613034) | Cod sursa (job #1972237)
import java.io.*;
import java.util.*;
class Main {
static long n, p;
static final long mod = 1999999973;
public static void main(String[] args) throws IOException
{
Scanner reader = new Scanner(new FileInputStream("lgput.in"));
PrintWriter writer = new PrintWriter(new FileWriter("lgput.out"));
n = reader.nextLong();
p = reader.nextLong();
writer.println(Pow(n, p));
writer.close();
reader.close();
}
private static long Pow(long a, long b)
{
long solution = 1;
while(b > 0)
{
if(b % 2 == 1) solution = (solution * a) % mod;
a = (a * a) % mod;
b >>= 1;
}
return solution;
}
}