Run ID:158134

提交时间:2026-08-20 16:38:40

#include <iostream> using namespace std; int main() { int A = 0, B = 0; for(int n = 1; n <= 1000; n++) { int cnt1 = 0, cnt0 = 0; int x = n; while(x > 0) { if(x & 1) cnt1++; else cnt0++; x >>= 1; } if(cnt1 > cnt0) A++; else B++; } cout << A << " " << B << endl; return 0; }