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: 1756kB
Author: 2018212212094
In contest: 1290

#include<bits/stdc++.h>
using namespace std;
int jud(int n) {
	int sum0 = 0, sum1 = 0, x;
	while (n) {
		x = n % 2;
		if (x == 1)sum1++;
		else sum0++;
		n /= 2;
	}
	if (sum1 > sum0)return 1;
	return 0;
}
int main() {
	int sum1 = 0, sum2 = 0;
	for (int i = 1; i <= 1000; i++) {
		if (jud(i) == 1)sum1++;
		else sum2++;
	}
	cout << sum1 << " " << sum2 << "\n";
	return 0;
}