Pagini recente » Cod sursa (job #218089) | Cod sursa (job #3239963) | Cod sursa (job #278755) | Cod sursa (job #964008) | Cod sursa (job #147676)
Cod sursa(job #147676)
program ridick;
var m,n,c : longint;
f : text;
function put(x,y:longint):longint;
var nr : longint;
begin
nr := 1;
x := x mod c;
while y<>0 do
if y mod 2 <> 0 then begin
nr := ((nr mod c)*(x mod c)) mod c;
y := y-1;
end
else begin
x := ((x mod c)*(x mod c)) mod c;
y := y div 2;
end;
put := nr;
end;
begin
assign(f,'lgput.in');
reset(f);
read(f,n,m);
c := 1999999973;
close(f);
assign(f,'lgput.out');
rewrite(f);
write(f,put(n,m));
close(f);
end.