Pagini recente » Cod sursa (job #1873767) | Cod sursa (job #978581) | Cod sursa (job #2095796) | Cod sursa (job #2566226) | Cod sursa (job #1672755)
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();
}
}