Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
166642 邓庆凯hzlz 二进制分类 C++ 通过 100 1 MS 244 KB 412 2024-08-19 15:04:10

Tests(4/4):


#include <bits/stdc++.h> using namespace std; int main() { int j,a,b,mod,m=0,n=0,x,y; cin>>x>>y; for(x=x; x<=y; x++) { j=x,a=0,b=0; while(j) { mod=j%2; j>>=1; if(mod) a++; else b++; } if(a>b) m++; else n++; } cout<<m<<' '<<n; return 0; }


测评信息: