Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
直接输出sub=y-x; if(sub<4)cout<<sub<<endl; else { sq=(int)sqrt(sub); if(sq*sq==sub){cout<<2*sq-1<<endl;continue;} else { if(sub>sq*sq+(2*sq+1)/2)cout<<2*sq+1<<endl; else cout<<2*sq<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator