![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
排序
xiaohunuli
这个作者很懒,什么都没留下…
展开
-
sort函数
头文件: #include using namespace std; 1 默认的sort函数是按升序排列 sort(a,a+n);//两个参数分别为待排数组的首地址和尾地址 2 可以自己写一个cmp函数,按特定意图排序 int cmp(const int &a,const int &b){ if(a>b) return 1; els转载 2013-03-19 21:49:45 · 524 阅读 · 0 评论 -
hdu 1157 Who's in the Middle
http://acm.hdu.edu.cn/showproblem.php?pid=1157 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6012 Accepted Submission(s): 3003 Problem原创 2013-03-19 22:16:13 · 334 阅读 · 0 评论 -
hdu 1425 sort
http://acm.hdu.edu.cn/showproble#include int m,n; const int N=1000005; int a[N]; int quicksort(int l,int r){ if(l<r){ int low=l; int high=r; int x=a[l]; while(low<high){ while(lo原创 2014-06-18 22:55:10 · 283 阅读 · 0 评论