Compile Error
foo.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
[Hydro](https://hydro.ac)提供评测服务
foo.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
[Hydro](https://hydro.ac)提供评测服务
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll T;
cin>>T;
while(T--){
ll x,y,res=0;
cin>>x>>y;
if(x>y) swap(x,y);
ll l=log2(x),r=log2(y);
// l+1 ~ r-1 的所有的解
// 枚举x~pow(2,l); pow(2,l) ~ y
for(int i=l+1;i<=r-1;i++) res+=i;
for(int i=0;i<l;i++)
if(pow(2,l+1)-1-pow(2,i)>=x&&pow(2,l+1)-1-pow(2,i)<y)
res++;
for(int i=0;i<r;i++)
if(pow(2,r+1)-1-pow(2,i)<=y&&pow(2,r+1)-1-pow(2,i)>=x)
res++;
cout<<res<<"\n";
}
}