标签:水题
题意:。。。
简单来说,就是要找出50万以内的数的真因子之和,再做个标记
代码:
#include <stdio.h>
#include <string.h>
#define M 500000
int a[M];
int ok[M];
void f()
{
int i, j;
for(i = 1; i < M; i ++){
for(j = 1; j*i < M; j ++){
a[i*j]+=i;
}
}
for(i = 1; i < M; i ++){
a[i]-=i;
if(a[i] < 1001){
ok[a[i]] = 1;
}
}
}
int main()
{
f();
int t, n;
scanf("%d", &t);
while(t --){
scanf("%d", &n);
printf("%s\n", ok[n]?"no":"yes");
}
}
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1999hdoj 1999 不可摸数 【数学】,布布扣,bubuko.com
标签:水题
原文地址:http://blog.csdn.net/shengweisong/article/details/38711665