标签:
Description
Input
Output
Sample Input
Sample Output
#include <stdio.h> #include <string.h> const int maxn=500000; int a[maxn+5]; int main() { int t,n; for(int i=1; i<=maxn; i++) a[i]=1; for(int i=2; i<=maxn/2; i++) { for(int j=2; j*i<=maxn; j++) a[j*i]+=i; } scanf("%d",&t); while(t--) { scanf("%d",&n); printf("%d\n",a[n]); } return 0; }
标签:
原文地址:http://www.cnblogs.com/cxbky/p/4907496.html