提交时间:2023-08-21 23:03:43
运行 ID: 99089
#include <iostream> using namespace std; bool bin(int x){ int l1=0,l2=0; while(x){ if(x%2) l1++; else l2++; x /= 2; } return l1>l2; } int main(){ int a,b,c=0; cin >> a >> b; for(int i=a;i<=b;i++){ if(bin(i)) c++; } cout << c << ' ' << b-a-c+1; return 0; }