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 |
Re:现排序,然后从n*m往下找,直到所有的数都被找过In Reply To:现排序,然后从n*m往下找,直到所有的数都被找过 Posted by:kric at 2007-04-13 21:20:21 > for(i=n*m,j=0,t=0;j<n;i--)//p[j]降序排列,t记录比当前p[j]大的数的个数,cnt是结果 > { > if(i==p[j]) > { > if(t) > { > t--; > j++; > } > else > { > cnt++; > j++; > } > } > else > t++; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator