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: 4ms
Memory: 1756kB
Author: 2018212212246
In contest: 1290

#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
const int MAXN = 1e3 + 5;
int main() 
{
	int cntA = 0, cntB = 0;
	for (int i = 1; i <= 1000; i++) 
	{
		int cnt0 = 0, cnt1 = 0;
		int tmp = i;
		while (tmp!=0) 
		{
			int t = tmp % 2;
			if (t == 1)
				cnt1++;
			else
				cnt0++;
			tmp /= 2;
			//printf("i:%d\n",i);
		}
		if (cnt1 > cnt0)
			cntA++;
		else
			cntB++;
	}
	printf("%d %d\n", cntA, cntB);
	return 0;
}