链接:
#include <stdio.h>
int main()
{
puts("转载请注明出处[vmurder]谢谢");
puts("网址:blog.csdn.net/vmurder/article/details/44589921");
}
题解:
以前玩过一件事,就是看20Y以内约数个数最多的数是哪个,约数个数是多少。
http://blog.csdn.net/vmurder/article/details/40429249
然后记得约数个数最多1536个,那么我们对于此题就可以打表啦!
,,,上面那篇博客还是我年幼无知的产品,不能用那个来打表的。
然后有一个性质就是若x=y*k,那么x的约数个数肯定比y多对吧~
那我们就可以先打个小的质数表然后搜索找出最优点,这样或许很慢,但是有了表以后就很快啦!
代码:
#include <cstdio>
using namespace std;
int a[1000]={1396755360,1102701600,735134400,698377680,551350800,367567200,294053760,245044800,183783600,147026880,122522400,110270160,73513440,61261200,43243200,36756720,32432400,21621600,17297280,14414400,10810800,8648640,7207200,6486480,4324320,3603600,2882880,2162160,1441440,1081080,720720,665280,554400,498960,332640,277200,221760,166320,110880,83160,55440,50400,45360,27720,25200,20160,15120,10080,7560,5040,2520,1680,1260,840,720,360,240,180,120,60,48,36,24,12,6,4,2,1,0};
int main()
{
int n;
scanf("%d",&n);
for(int i=0;;i++)
{
if(n>=a[i])
{
printf("%d\n",a[i]);
return 0;
}
}
}