Pagini recente » Cod sursa (job #3134041) | Cod sursa (job #420599) | Cod sursa (job #2945236) | Cod sursa (job #2343589) | Cod sursa (job #1672736)
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
class Main{
public static void main(String[] args) throws FileNotFoundException, UnsupportedEncodingException {
Scanner scanner = new Scanner(new FileInputStream("lgput.in"));
long base = scanner.nextLong();
long exponent = scanner.nextLong();
long modulo = 1999999973;//scanner.nextLong();
long result = 1;
while (exponent > 0) {
if (exponent % 2 == 1) {
result = (result * base) % modulo;
}
base = (base * base) % modulo;
exponent = exponent / 2;
}
PrintWriter writer = new PrintWriter("lgput.out", "UTF-8");
writer.println(result);
writer.close();
}
}