提交时间:2024-03-17 12:16:32
运行 ID: 43633
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; #define ll long long int main() { int l, r; cin >> l >> r; int sum = 0; for(int i = l; i <= r; i++) { int tmp = i; while(tmp) { if(tmp%2==1) sum++; tmp /= 2; } } cout << sum; return 0; }