Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
163501 赵奕杰 二进制数问题 C++ Accepted 1 MS 256 KB 286 2026-10-25 14:57:17

Tests(1/1):


Code:

#include <bits/stdc++.h> using namespace std; int main(){ int a=0,b=0,t; for(int i=1;i<=1000;i++){ t=i; int y=0,l=0; while(t>0){ if(t%2==1) y++; else l++; t/=2; } if(y>l) a++; else if(y<=l) b++; } cout<<a<<" "<<b; return 0; }