唐钧 • 2个月前
using namespace std;
ll r0,ans=0; stacks;
void clear() {
while(!s.empty())
{
if(s.top()==1)
{
r0++;
}
s.pop();
}
return;
}
void bin(ll a) {
ll sb=a;
while(sb>=1)
{
s.push(sb%2);
sb/=2;
}
}
int main() {
ll n,s,t;
cin>>n>>s>>t;
for(int i=s;i<=t;i++)
{
r0=0;
bin(i);
clear();
if(r0<=n)
{
ans++;
}
}
cout<<ans;
return 0;
} 、、、
评论: