Start: Jun, 30, 2019 09:00:00
2019年度暑期短学期第十天 助教场
End: Jul, 08, 2019 23:59:00
Time elapsed:
Time remaining:

Problem_ID: B
Result: Accepted
Time: 3ms
Memory: 1760kB
Author: 2018212212155
In contest: 1290

#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));
//	}
}