Time Limit: 1000MS | Memory Limit: 10000K | |
Total Submissions: 23358 | Accepted: 14720 |
Description
Input
Output
Sample Input
2 5 100
Sample Output
2 10
Source
1 #include<iostream> 2 #include<string.h> 3 #include<stdio.h> 4 #include<ctype.h> 5 #include<algorithm> 6 #include<stack> 7 #include<queue> 8 #include<set> 9 #include<math.h> 10 #include<vector> 11 #include<map> 12 #include<deque> 13 #include<list> 14 using namespace std; 15 int main() 16 { 17 int n,i,j,k,a,count,counter; 18 scanf("%d",&n); 19 for(i=1;i<=n;i++) 20 { 21 counter=0; 22 scanf("%d",&a); 23 for(k=1;k<=a;k++) 24 { 25 count=0; 26 for(j=1;j<=a;j++) 27 if(k%j==0) 28 count++; 29 if(count%2!=0) 30 counter++; 31 } 32 printf("%d\n",counter); 33 } 34 return 0; 35 }
poj 1218 THE DRUNK JAILER,布布扣,bubuko.com
原文:http://www.cnblogs.com/qscqesze/p/3880172.html