Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
163238 王丞杰 二进制数问题 C++ Accepted 0 MS 260 KB 306 2026-10-24 16:12:24

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int A=0,B=0; for(int i=1;i<=1000;i++){ int k=i,a1=0,b1=0; while(k>0){ if(k&1==1){ a1++; } else{ b1++; } k=k>>1; } if(a1>b1){ A++; } else{ B++; } } cout<<A<<" "<<B; return 0; }