hdu-1800 Flying to the Mars
来源:互联网 发布:阿里云订单退款 编辑:程序博客网 时间:2024/06/05 10:17
就是一个map水题,只要统计等级相同的最大人数就行了,因为相同等级的不可能在一起。
#include<iostream>#include<map>using namespace std;int main(){int n,a,i,max;map<int,int>m;while(scanf("%d",&n)!=EOF){max=0;m.clear();for(i=0;i<n;i++){scanf("%d",&a);m[a]++;if(m[a]>max)max=m[a];}printf("%d\n",max);}return 0;}/*假设有若干个飞行员,{{A1,A2,A3...AK},{B1,B2,B3,...Bm}......{F1,F2,F3.....Fn}}。其已经按照等级由低到高排好序,在同一个集合里的飞行员等级相同。若需要最少数目的扫帚,则只能是{A1,B1.....F1},{A2,B2....F2}..这样进行组合,扫帚数目最少。因此决定所需最少扫帚数目的集合是含有飞行员最多的集合,即同一等级数目最多的飞行员集合。因此可以采用STL中的map直接实现。*/
0 0
- Flying to the Mars (hash) 1800 hdu
- hdu 1800 Flying to the Mars
- Hdu-1800 Flying to the Mars
- hdu 1800 Flying to the Mars
- hdu 1800 Flying to the Mars
- HDU-1800-Flying to the Mars
- hdu 1800 Flying to the Mars
- hdu 1800 Flying to the Mars
- hdu 1800 Flying to the Mars
- HDU 1800 Flying to the Mars
- HDU 1800 Flying to the Mars STL
- HDU -1800 Flying to the Mars
- hdu - 1800 - Flying to the Mars
- HDU 1800 Flying to the Mars(trie)
- HDU--1800 -- Flying to the Mars
- HDU-1800 - Flying to the Mars
- hdu 1800 Flying to the Mars【水水】
- HDU 1800 Flying to the Mars
- 设计模式七大原则
- javascript学习-2 - Javascript教程
- OpenCV+VS2010+JavaCV+Eclipse+Win7
- android 无线调试
- JavaDES加密解密算法
- hdu-1800 Flying to the Mars
- 第十三周项目3--与圆心相连的直线
- 编程大赛编程大赛进入
- 操作系统经典书籍推荐
- Android手机平板两不误,使用Fragment实现兼容手机和平板的程序
- js堆栈溢出错误
- CAN总线数据帧解码(示波器)
- 用List的迭代器遇到的错误
- apt-get 的常规用法