0_0_15680750_9252.cpp: In function 'int searchindex()':
0_0_15680750_9252.cpp:2:93: error: lvalue required as left operand of assignment
long long aans[55],alen[55],m;int searchindex(){int l=1,r=54,mid,ans=0;while(l<=r){mid=(l+r)=1;if(m==alen[mid])return mid;if(m>alen[mid]){l=mid+1;ans=(mid>ans?mid:ans);}else r=mid-1;}return ans;}int main(){long long ans=1,len=1;for(int i=1;len<=20000000000000000;++i){aans[i]=ans;alen[i]=len;ans+=(ans+len+1);len+=(len+1);}int T;scanf("%d",&T);long long tans;while(T--){scanf("%lld",&m);tans=0;while(!m){int x1=searchindex();m-=alen[x1];tans+=aans[x1];if(!m)break;tans+=m;m-=1;}printf("%lld\n",tans);}return 0;}
^
|