讨论 / 过8个点,求正解
btbtbt 2013-03-30 02:13:00
点我顶贴 收藏 删除
program rq88;

var

n,m,i,toto,tot,ans,j:longint;

begin

read(n,m);

for i:=n to m do

begin

tot:=1; toto:=1;

for j:=2 to trunc(sqrt(i)) do

if i mod j=0 then tot:=tot+j+(i div j);

for j:=2 to trunc(sqrt(tot)) do

if tot mod j=0 then toto:=toto+j+(tot div j);

if (toto=i)and(toto>=n)and(toto<=m) then inc(ans);

end;

if ans>=2 then writeln(ans div 2) else writeln(ans);

readln(n);

end.

#1 btbtbt@2013-03-30 02:13:00
回复 删除
program rq88;

var

n,m,i,toto,tot,ans,j:longint;

begin

read(n,m);

ans:=0;

for i:=n to m do

begin

tot:=1; toto:=1;

for j:=2 to trunc(sqrt(i)) do

if i mod j=0 then tot:=tot+j+(i div j);

if i<tot then

begin

for j:=2 to trunc(sqrt(tot)) do

if tot mod j=0 then toto:=toto+j+(tot div j);

if toto=i then inc(ans);

end;

end;

writeln(ans);

readln(n);

end.

过了。。。好感动

#2 g++@2016-04-11 05:33:19
回复 删除
var x,y,s:longint;

begin

assign(input,'in.txt');reset(input);

assign(output,'out.txt');rewrite(output);

read(x,y);

s:=0;

if (x<=220) and (y>=220) then inc(s);

if (x<=1184) and (y>=1184) then inc(s);

if (x<=2620) and (y>=2620) then inc(s);

if (x<=5020) and (y>=5020) then inc(s);

if (x<=6232) and (y>=6323) then inc(s);

if (x<=10744) and (y>=10744) then inc(s);

if (x<=12285) and (y>=12285) then inc(s);

if (x<=17296) and (y>=17296) then inc(s);

if (x<=63020) and (y>=63020) then inc(s);

if (x<=66928) and (y>=66928) then inc(s);

if (x<=67095) and (y>=67095) then inc(s);

if (x<=69615) and (y>=69615) then inc(s);

if (x<=79750) and (y>=79750) then inc(s);

if (x<=100485) and (y>=100485) then inc(s);

if (x<=122265) and (y>=122265) then inc(s);

if (x<=122368) and (y>=122368) then inc(s);

if (x<=141664) and (y>=121664) then inc(s);

if (x<=142310) and (y>=142310) then inc(s);

if (x<=171856) and (y>=171856) then inc(s);

if (x<=176272) and (y>=176272) then inc(s);

if (x<=185368) and (y>=185368) then inc(s);

if (x<=196724) and (y>=196724) then inc(s);

if (x<=280540) and (y>=280540) then inc(s);

if (x<=308620) and (y>=308620) then inc(s);

if (x<=319550) and (y>=319550) then inc(s);

if (x<=356408) and (y>=356408) then inc(s);

if (x<=437456) and (y>=437456) then inc(s);

if (x<=469028) and (y>=469028) then inc(s);

if (x<=503056) and (y>=503056) then inc(s);

if (x<=522405) and (y>=522405) then inc(s);

if (x<=600392) and (y>=600392) then inc(s);

if (x<=609928) and (y>=609928) then inc(s);

if (x<=624184) and (y>=624184) then inc(s);

if (x<=635624) and (y>=635624) then inc(s);

if (x<=643336) and (y>=643336) then inc(s);

if (x<=667964) and (y>=667964) then inc(s);

if (x<=726104) and (y>=726104) then inc(s);

if (x<=802725) and (y>=802725) then inc(s);

if (x<=879712) and (y>=879712) then inc(s);

if (x<=898216) and (y>=898216) then inc(s);

if (x<=947835) and (y>=947835) then inc(s);

if (x<=998104) and (y>=998104) then inc(s);

if (x<=1077890) and (y>=1077890) then inc(s);

if (x<=1154450) and (y>=1154450) then inc(s);

if (x<=1156870) and (y>=1156870) then inc(s);

if (x<=1175265) and (y>=1175265) then inc(s);

if (x<=1185376) and (y>=1185376) then inc(s);

if (x<=1280565) and (y>=1280565) then inc(s);

if (x<=1328470) and (y>=1328470) then inc(s);

if (x<=1358595) and (y>=1358595) then inc(s);

if (x<=1392368) and (y>=1392368) then inc(s);

if (x<=1466150) and (y>=1466150) then inc(s);

if (x<=1468324) and (y>=1469324) then inc(s);

if (x<=1511930) and (y>=1511930) then inc(s);

if (x<=1669910) and (y>=1669910) then inc(s);

if (x<=1798875) and (y>=1798875) then inc(s);

if (x<=2082464) and (y>=2082464) then inc(s);

if (x<=2236570) and (y>=2236570) then inc(s);

if (x<=2652728) and (y>=2652728) then inc(s);

if (x<=2723792) and (y>=2723792) then inc(s);

if (x<=2728726) and (y>=2728726) then inc(s);

if (x<=2739704) and (y>=2739704) then inc(s);

if (x<=2802416) and (y>=2802416) then inc(s);

if (x<=2803580) and (y>=2803580) then inc(s);

if (x<=3276856) and (y>=3276856) then inc(s);

if (x<=3606850) and (y>=3606850) then inc(s);

if (x<=3786904) and (y>=3786904) then inc(s);

if (x<=3805264) and (y>=3805264) then inc(s);

if (x<=4238984) and (y>=4238984) then inc(s);

if (x<=4246130) and (y>=4246130) then inc(s);

if (x<=4259750) and (y>=4259750) then inc(s);

if (x<=4482765) and (y>=4482765) then inc(s);

if (x<=4532710) and (y>=4532710) then inc(s);

if (x<=4604776) and (y>=4604776) then inc(s);

if (x<=5123090) and (y>=5123090) then inc(s);

if (x<=5147032) and (y>=5147032) then inc(s);

if (x<=5232010) and (y>=5232010) then inc(s);

if (x<=5357625) and (y>=5357625) then inc(s);

if (x<=5385310) and (y>=5385310) then inc(s);

if (x<=5459176) and (y>=5459176) then inc(s);

if (x<=5726072) and (y>=5726072) then inc(s);

if (x<=5730615) and (y>=5730615) then inc(s);

if (x<=5864660) and (y>=5864660) then inc(s);

if (x<=6329416) and (y>=6329416) then inc(s);

if (x<=6377175) and (y>=6377175) then inc(s);

if (x<=6955216) and (y>=6955216) then inc(s);

if (x<=6993610) and (y>=6993610) then inc(s);

if (x<=7275532) and (y>=7275532) then inc(s);

if (x<=7288930) and (y>=7288930) then inc(s);

if (x<=7489112) and (y>=7489112) then inc(s);

if (x<=7577350) and (y>=7577350) then inc(s);

if (x<=7677248) and (y>=7677248) then inc(s);

if (x<=7800544) and (y>=7800544) then inc(s);

if (x<=7850512) and (y>=7850512) then inc(s);

if (x<=8262136) and (y>=8262136) then inc(s);

if (x<=8619765) and (y>=8619765) then inc(s);

if (x<=8666860) and (y>=8666860) then inc(s);

if (x<=8754130) and (y>=8754130) then inc(s);

if (x<=8826070) and (y>=8826070) then inc(s);

if (x<=9071685) and (y>=9071685) then inc(s);

if (x<=9199496) and (y>=9199496) then inc(s);

if (x<=9206925) and (y>=9206925) then inc(s);

if (x<=9339704) and (y>=9339704) then inc(s);

if (x<=9363584) and (y>=9363584) then inc(s);

if (x<=9478910) and (y>=9478910) then inc(s);

if (x<=9491625) and (y>=9491625) then inc(s);

if (x<=9660950) and (y>=9660950) then inc(s);

if (x<=9773505) and (y>=9773505) then inc(s);

writeln(s);

end.

查看更多回复
提交回复