/* Non-contact number
Problem Description
S (n) it is a positive integer n the sum of the true coefficients, less than n divisible by n factors. For example S (12) =1+2+3+4+6=16. Whatever assumptions
Number M,s (m) is not equal to N, claiming n non-contact number.
Input
Includes multiple sets of data, first entering T, which indicates that there is a T group of data. 1 rows per set of data give N (2<=n<=1000) is an integer.
Output
Assuming n is not touched, output yes, otherwise output no
Sample Input
3
2
5
8
Sample Output
Yes
Yes
No
*/
/* Use the table method to place the true factor of N and save to A[n].
Note that the upper limit of the table is determined m>=500000;
*/
#include <stdio.h>
#define M 500010
__int64 A[m];
int sum[1010];
void ASD ()
{
int N;
N=M/2;
int i,j;
for (i=1;i<n;i++)
for (j=2*i;j<m;j+=i)
A[j]+=i;
for (i=0;i<m;i++)
{
if (a[i]<=1000)
Sum[a[i]]=1;
}
}
int main ()
{
int test,i;
scanf ("%d", &test);
ASD ();
while (test--)
{
int t;
scanf ("%d", &t);
if (Sum[t])
printf ("no\n");
Else
printf ("yes\n");
}
return 0;
}
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
Non-contact number (Hangzhou electric 1999)