Pagini recente » Cod sursa (job #1958826) | Cod sursa (job #1225379) | Cod sursa (job #83015) | Cod sursa (job #96215) | Cod sursa (job #1116313)
Program logn;
var n,p: longint;
function putere(baza,exp : longint) : longint;
var aux : longint; rest: int64;
begin
if exp=0 then putere:=1
else begin
aux:=1; rest:=1999999973;
while exp>0 do
begin
if exp mod 2=1 then aux:=(aux*baza) mod rest;
baza:=sqr(baza) mod rest;
exp:=exp div 2;
end;
putere:=aux;
end;
end;
begin
assign(input,'lgput.in'); reset(input);
assign(output,'lgput.out'); rewrite(output);
readln(n,p);
writeln(putere(n,p) mod 1999999973);
close(input); close(output);
end.