Pagini recente » Cod sursa (job #2055490) | Cod sursa (job #2837517) | Cod sursa (job #3221744) | Cod sursa (job #2531909) | Cod sursa (job #1972235)
import java.io.*;
import java.util.*;
class add {
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;
}
}