标签:des style blog class code java
Time Limit: 2000/1000 MS
(Java/Others) Memory Limit: 65536/32768 K
(Java/Others)
Total Submission(s): 7966 Accepted
Submission(s): 2024
1 #include<iostream> 2 #include<stdio.h> 3 #include<cstring> 4 #include<cstdlib> 5 #include<set> 6 using namespace std; 7 8 bool hash[1001]; 9 void init() 10 { 11 int i,j; 12 memset(hash,false,sizeof(hash)); 13 for(i=2;i<=1000000;i++) 14 { 15 int sum=1; 16 for(j=2;j*j<=i;j++) 17 { 18 if(i%j==0) 19 { 20 sum=sum+j; 21 if(i/j!=j) sum=sum+i/j; 22 if(sum>1000)break; 23 } 24 } 25 if(sum<=1000) hash[sum]=true; 26 } 27 } 28 int main() 29 { 30 init(); 31 int T; 32 scanf("%d",&T); 33 while(T--) 34 { 35 int n; 36 scanf("%d",&n); 37 if(hash[n]==true) 38 printf("no\n"); 39 else printf("yes\n"); 40 } 41 return 0; 42 }
hdu 1999 不可摸数 水题。,布布扣,bubuko.com
标签:des style blog class code java
原文地址:http://www.cnblogs.com/tom987690183/p/3720054.html