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: 2017212212083
In contest: 1290

#include <bits/stdc++.h>

using namespace std;

int A, B;

int main() {
    for (int i = 1; i <= 1000; ++i) {
        int One = 0, Zero = 0, x = i;
        while (x) {
            if (x & 1) {
                One++;
            } else {
                Zero++;
            }
            x >>= 1;
        }
        if (One > Zero) {
            ++A;
        } else {
            ++B;
        }
    }
    printf("%d %d\n", A, B);
    return 0;
}