- 题解
GPGEN20261018002
- @ 2026-10-18 15:04:58
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int l,r,ans=0,t;
cin>>l>>r;
for(int i=l;i<=r;i++){
t=i;
while(t!=1){
ans+=(t%2);
t/=2;
}
ans++;
}
cout<<ans<<endl;
return 0;
}
0 条评论
目前还没有评论...