hdu 1280 计数排序
来源:互联网 发布:php https curl 编辑:程序博客网 时间:2024/06/06 00:34
http://acm.hdu.edu.cn/showproblem.php?pid=1280
#include <stdio.h>#include <string.h>#define N 10001int n,m;int a[N],cc[N];int main(){ while(scanf("%d%d",&n,&m) != EOF) { memset(cc,0,sizeof(cc)); int i,j; int max = 0; for(i = 0; i < n; ++i) { scanf("%d",&a[i]); if(max < a[i]) max = a[i]; for(j = 0; j < i; ++j) cc[a[i] + a[j]]++; } for(j = 0,i = (max<<1); m;--i) while(cc[i]-- && m) { --m; a[j++] = i; } for(i = 0; i < j-1; ++i)///额。。。PE了一次。。。 printf("%d ",a[i]); printf("%d\n",a[i]); } return 0;}
- hdu 1280 计数排序
- hdu 4917 拓扑排序计数
- hdu 1280 前m大的数 计数排序
- HDU 1280 前m大的数(计数排序)
- 计数排序——HDU 1425
- hdu 5738 Eureka 极角排序 计数
- 计数排序
- 计数排序
- 计数排序
- 计数排序
- 计数排序
- 计数排序
- 计数排序
- 计数排序
- 计数排序
- 计数排序
- 计数排序
- 计数排序
- Android 电视退出程序Animation
- hnu 12311 hiscale 判圆角矩形相交
- 读《Attribute and Simile Classifiers for Face Verification》有感
- 输出缓冲区的管理
- 排序
- hdu 1280 计数排序
- m_pConnection->Open()函数参数
- poj 2299 求逆序对 树状数组 归并排序
- IIS7 url重写后 ,重写的aspx文件能运行正常,不需要重写的html不正常
- IIS7 url重写后 ,重写的aspx文件能运行正常,html不正常
- myeclipse安装svn插件的多种方式
- Chapter 8. Customizing new and delete
- hdu 1029 计数 水题
- 进度条