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 |
那这样做有什么问题呢???In Reply To:sigh...一天到晚就只想着数据…… Posted by:frkstyc at 2007-09-29 01:47:15 sort(a,a+n); i=0; j=n-1; while(k) { if(k>=2) { t1=a[i]*a[i+1]; t2=a[j]*a[j-1]; if(t1>=t2) { flag[i]=flag[i+1]=1; i=i+2; } else { flag[j]=flag[j-1]=1; j-=2; } k-=2; } else { flag[j]=1; k=0; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator