Pagini recente » Cod sursa (job #1689982) | Monitorul de evaluare | Istoria paginii utilizator/cristinavera | Cod sursa (job #1185740) | Cod sursa (job #2142040)
import java.io.*;
import java.util.Scanner;
class MyMath {
static private final long MOD = 1999999973L;
private MyMath() {}
static long pow(long a, long b) {
long res = 1L;
for (long i = 0; (1L << i) <= b; i++) {
if (((1L << i) & b) != 0) {
res = (res * a) % MyMath.MOD;
}
a = (a * a) % MyMath.MOD;
}
return res % MyMath.MOD;
}
}
public class Main {
public static void main(String[] args) throws IOException {
FileReader in = null;
FileWriter out = null;
try {
in = new FileReader("lgput.in");
out = new FileWriter("lgput.out");
Scanner input = new Scanner(in);
long x, y;
x = input.nextLong();
y = input.nextLong();
String res = Long.toString(MyMath.pow(x, y));
out.write(res);
input.close();
} finally {
if (in != null)
in.close();
if (out != null)
out.close();
}
}
}