1 条题解
-
1
using namespace std; bool chk(int n){ for(int x=0;pow(2,x)<=n;x++){ for(int y=0;pow(2,y)<=n;y++){ if(n == pow(2,x) + pow(2,y)){ return true; } } } return false; } int main(){ int l,r,cnt=0; cin >> l >> r; for(int i=l;i<=r;i++){ if(chk(i)==true) cnt++; } cout << cnt; return 0; }
信息
- ID
- 614
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 9
- 标签
- (无)
- 递交数
- 152
- 已通过
- 11
- 上传者