

这是我的代码,答案的第一个数应该是对的,但是后面的部分超时/错误了
#include<bits/stdc++.h>
using namespace std;
int t,l,r;
long long pow(long long a,long long b){
if(b==0) return 1;
if(b==1) return a;
long long ret=pow(a,b/2);
if(b%2==1) return ret*(ret)*(a);
return ret*ret;
}
int main(){
cin>>t;
while(t--){
cin>>l>>r;
int x=l,cnt=0,ans=0;
while(x<=r){
x*=2,cnt++;
}
for(int i=l;i<=r;i++){
for(int j=2;;j++){
int x=cnt-1;
//cout<<i<<' '<<i*pow(2,(cnt-1))<<endl;
if(i*pow(j,(cnt-1))<=r) ans++;
else break;
}
}
cout<<cnt<<' '<<ans<<endl;
}
return 0;
}