1053: [HAOI2007]反素数ant
Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 3593 Solved: 2107
[ Submit][ Status][ Discuss]
Description
对于任何正整数x,其约数的个数记作g(x)。例如g(1)=1、g(6)=4。如果某个正整数x满足:g(x)>g(i) 0<i<x
,则称x为反质数。例如,整数1,2,4,6等都是反质数。现在给定一个数N,你能求出不超过N的最大的反质数么
?
Input
一个数N(1<=N<=2,000,000,000)。
Output
不超过N的最大的反质数。
Sample Input
1000
Sample Output
840
HINT
Source
思考
不废话,懒得dfs,打表就行了……
#include<cstdio>
int a[100]={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(register int i=0;;i++){
if(n>=a[i]){
printf("%d\n",a[i]);
return 0;
}
}
}