F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

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;}
                                                                                             ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-12-03 01:33:11, Gzip enabled