Pagini recente » Cod sursa (job #2629375) | Cod sursa (job #2326552) | Cod sursa (job #1306535) | Cod sursa (job #780871) | Cod sursa (job #1672747)
import java.io.*;
import java.util.Scanner;
/**
* Created by slycer on 4/3/16.
*/
public class Main {
private static long MOD = 1999999973l;
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();
}
}