Pagini recente » Cod sursa (job #1231542) | Cod sursa (job #915303) | Cod sursa (job #515001) | Cod sursa (job #1969380) | Cod sursa (job #146662)
Cod sursa(job #146662)
const m=1999999973;
var a,b:int64;
f:text;
function putere(b:int64):int64;
var nr:int64;
begin
if b=1 then putere:=a mod m
else
begin
nr:=putere(b shr 1) mod m;
if not odd(b) then putere:=(nr*nr) mod m
else putere:=(nr*nr*a) mod m;
end;
end;
begin
assign(f,'lgput.in');
reset(f);
read(f,a,b);
close(f);
assign(f,'lgput.out');
rewrite(f);
write(f,putere(b));
close(f);
end.