Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
162669 田子熙 二进制数问题 C++ Accepted 1 MS 260 KB 345 2026-10-18 13:08:20

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 n=i; int s1=0,s0=0; while(n>0){ if(n%2==1) s1++; else s0++; n/=2; } if(s1>s0) A++; else B++; } cout<<A<<" "<<B; return 0; }