提交时间:2024-08-19 17:00:03
运行 ID: 167605
#include <bits/stdc++.h> using namespace std; int main(){ int i,a,b,mod,t1=0,t2=0,x,y; cin>>x>>y; for(; x<=y; x++) { i=x,a=0,b=0; while(i) { mod=i%2; i>>=1; if(mod) a++; else b++; } if(a>b) t1++; else t2++; } cout<<t1<<' '<<t2; return 0; }