Result: Accepted
Time: 3ms
Memory: 1760kB
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<cmath>
using namespace std;
int i,j,t1,t2;
int a[1010];
int judge(int x){
int p;
int t3=0,t4=0;
while(x){
p=x%2;x=x/2;
if(p==1) t3++;
else t4++;
}
if(t3>t4) return 1;
else return 0;
}
int main(){
t1=t2=0;
for(i=1;i<=1000;i++){
if(judge(i)) t1++;
else t2++;
}
printf("%d %d",t1,t2);
// printf("\n");
// for(i=1;i<=10;i++){
// printf("%d ",judge(i));
// }
}