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: 17396kB
Author: 2018212212028
In contest: 1290

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<set>
#define ll long long
using namespace std;
const int maxn = 1001000;
const int inf = 0x3f3f3f3f;
#define PI 3.141592653589
#define fr(i,r,l) for(int i=r;i<=l;i++)
ll a[maxn];
ll b[maxn];
int main()
{
	int sum = 0, ans = 0;
	fr(i, 1, 1000)
	{
		int aq = 0, qw = 0;
		int n = i;
		while (n)
		{
			if (n % 2 == 1)
				aq++;
			else qw++;
			n = n / 2;
		}
		if (aq > qw)
		{
			sum++;
		}
		else ans++;
	}
	cout << sum << ' ' << ans << endl;
}