社区讨论
85 求调 必关
B4357[GESP202506 二级] 幂和数参与者 3已保存回复 4
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 4 条
- 当前快照
- 1 份
- 快照标识符
- @mk23o8xq
- 此快照首次捕获于
- 2026/01/06 12:39 上个月
- 此快照最后确认于
- 2026/01/09 19:20 上个月
CPP
#include<bits/stdc++.h>
using namespace std;
int l,r,cnt,t,s;
int main()
{
cin>>l>>r;
for(int i=l;i<=r;i++)
{
s=0;
t=i;
while(t>=1&&s<=2)
{
s+=t%2;
t/=2;
}
s+=t%2;
if(s<=2) cnt++;
}
cout<<cnt;
return 0;
}
回复
共 4 条回复,欢迎继续交流。
正在加载回复...