标签:
1 #include<stdio.h>//月老的烦恼(1)(478) 2 #include<math.h> 3 #include<string.h> 4 #define MAX 500000 5 int a[MAX]; 6 void count() 7 { 8 int i,j,t; 9 t=MAX/2; 10 memset(a,0,sizeof(a)); 11 for(i=1;i!=t;i++){ 12 for(j=i*2;j<=MAX;j+=i){ 13 a[j]++; 14 } 15 } 16 } 17 int main() 18 { 19 int x,n; 20 scanf("%d",&x); 21 count(); 22 while(x--){ 23 scanf("%d",&n); 24 printf("%d\n",a[n]); 25 } 26 return 0; 27 }
标签:
原文地址:http://www.cnblogs.com/minimalism/p/4537610.html