Pagini recente » Cod sursa (job #2496886) | Cod sursa (job #146407) | Cod sursa (job #2927213) | Cod sursa (job #3293127) | Cod sursa (job #146287)
Cod sursa(job #146287)
var fi,fo:text;
n,p,m:int64;
function exp(p:int64):int64;
var aux:int64;
begin
if p=0 then exp:=1
else
begin
aux:=exp(p shr 1);
if p and 1=0 then exp:=((aux mod m)*(aux mod m)) mod m
else exp:=((aux mod m)*(aux mod m)*n) mod m;
end;
end;
begin
assign(fi,'lgput.in'); reset(fi);
assign(fo,'lgput.out'); rewrite(fo);
read(fi,n,p);
m:=1999999973;
n:=n mod m;
writeln(fo,exp(p));
close(fi);
close(fo);
end.