HDU1425:sort
来源:互联网 发布:linux arm 交叉编译 编辑:程序博客网 时间:2024/05/16 07:15
hash原来做过
<pre name="code" class="cpp">#include<cstdio>#include<cstring>#include<iostream>using namespace std;const int M = 1000001;#define MIN -99999999bool hashh[M];void init(){ for(int i=0;i<M;i++) hashh[i]=false;}int main(){ int n,m,maxn; while(scanf("%d%d",&n,&m)!=EOF){ int p; init(); maxn = MIN; for(int i=0;i<n;i++) { scanf("%d",&p); p += 500000; hashh[p]=true; if(p>maxn) maxn = p; } printf("%d",maxn - 500000); if(--m){ for(int i=maxn - 1; i>= 0; --i){ if(hashh[i]){ printf(" %d",i-500000); --m; if(!m) break; } } } puts(""); } return 0;}
0 0
- hdu1425 sort
- HDU1425:sort
- HDU1425-sort
- HDU1425----sort
- hdu1425.sort
- HDU1425:sort
- HDU1425 sort
- HDU1425-sort
- HDU1425 sort
- hdu1425 sort (hash)
- hdu1425 sort 解题报告
- sort HDU1425 TLE?!
- HDU1425 sort【水题】
- hdu1425——sort
- hdu1425 sort (朴素)
- hdu1425 sort(哈希表)
- HDU1425 <sort 快排>
- HDU1425 sort 【STL堆排序】
- sql profile使用
- 大学课程--计算机网络
- Qt-Linguist工具简单介绍和使用方法
- ios view的frame和bounds之区别(位置和大小)
- Servlet--ServletContext接口
- HDU1425:sort
- VC++调试,TRACE()函数的用法
- 从科学网转的,蛮有意思,哈哈
- 黑马程序员------TreeSet的自然排序与比较器
- mysql无法远程连接
- 类名.class, class.forName(), getClass()区别
- NSNotificationCenter 的使用详解
- sql profile介绍
- linux-2.6.22.6中uImage生成完全解析