lrz_1995 2009-03-08 00:01:00
点我顶贴
收藏
删除
快var ci,a,b,i,j,p:longint;
function find(x:longint):longint;
var i,s:longint;
begin
s:=1;
for i:=2 to trunc(sqrt(x)) do
if x mod i=0 then
s:=s+i+x div i;
if trunc(sqrt(x))+trunc(sqrt(x))=x then
dec(s,trunc(sqrt(x)));
find:=s;
end;
begin
read(a,b);
for i:=a to b do
begin
p:=find(i);
if i<p then
if p-i<=100000 then
if i=find(p) then
inc(ci);
end;
writeln(ci);
end.