const ans:array[1..234]of longint=(220,1184,2620,5020,6232,10744,12285,17296,
63020,66928,67095,69615,79750,100485,122265,
122368,141664,142310,171856,176272,185368,196724,280540,308620,319550,356408,437456,
469028,503056,522405,600392,609928,624184,635624,643336,667964,726104,802725,879712,
898216,947835,998104,1077890,1154450,1156870,1175265,1185376,1280565,1328470,1358595,
1392368,1466150,1468324,1511930,1669910,1798875,2082464,2236570,2652728,2723792,
2728726,2739704,2802416,2803580,3276856,3606850,3786904,3805264,4238984,4246130,
4259750,4482765,4532710,4604776,5123090,5147032,5232010,5357625,5385310,5459176,
5726072,5730615,5864660,6329416,6377175,6955216,6993610,7275532,7288930,7489112,
7577350,7677248,7800544,7850512,8262136,8619765,8666860,8754130,8826070,9071685,
9199496,9206925,9339704,9363584,9478910,9660950,9773505,10254970,10533296,10572550,
10596368,10634085,10992735,11173460,11252648,11498355,11545616,11693290,11905504,
12397552,12707704,13671735,13813150,13921528,14311688,14426230,14443730,14654150,
15002464,15363832,15938055,16137628,16871582,17041010,17257695,17754165,17844255,
17908064,18056312,18194715,18655744,20014808,20022328,20308995,21448630,22227075,
22249552,22508145,22608632,23358248,23389695,23628940,24472180,25596544,25966832,
26090325,28118032,28608424,30724694,30830696,31536855,31818952,32205616,32642324,
32685250,33501825,34256222,34364912,34765731,35115795,35361326,35373195,35390008,
35472592,37363095,37784810,37848915,38637016,38663950,38783992,38807968,43096904,
44139856,45263384,46237730,46271745,46521405,46555250,46991890,48639032,48641584,
49215166,50997596,52695376,56055872,56512610,56924192,58580540,59497888,63560025,
63717615,66595130,66854710,67729064,67738268,68891992,71015260,71241830,72958556,
73032872,74055952,74386305,74769345,75171808,75226888,78088504,78447010,79324875,
80422335,82633005,83135650,84521745,84591405,86158220,87998470,88144630,89477984,
90437150,91996816,93837808,95629904,95791430,96304845,97041735);
var i,j,k,m,n:longint;
begin
readln(m,n);
for i:=1 to 234 do
if (ans[i]>=m)and(ans[i]<=n) then inc(k);
writeln(k);
end.
数据太强大了……
这张表我打了二三十分钟……
哪位大牛能说一下又没有更好的做法……
Thanks……
a,b,x,y,i,j,tot:longint;
begin
read(a,b);tot:=0;
for i:=a to b do
if not odd(i)or(i mod 10=5)then begin
x:=1;
for j:=2 to trunc(sqrt(i))do
if i mod j=0 then inc(x,j+i div j);
if(x>i)and(x mod i<>0)then begin
y:=1;
for j:=2 to trunc(sqrt(x))do
if x mod j=0 then inc(y,j+x div j);
if y=i then inc(tot);
end;
end;
writeln(tot);
end.