首页 > 其他 > 详细

HDU 1800 Flying to the Mars

时间:2014-08-20 02:31:15      阅读:434      评论:0      收藏:0      [点我收藏+]

可能是数据水吧

看到网上的代码都是什么map函数的 但是直接一水而过了

 


#include<stdio.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<stack>
#define mem(a,b) memset(a,b,sizeof(a))
#define ll __int64
#define MAXN 1000
#define INF 0x7ffffff
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
int a[5000];
int main()
{
int i,j,n;
while(scanf("%d",&n)!=EOF)
{
for(i=0;i<n;i++)
scanf("%d",&a[i]);
sort(a,a+n);
int cnt;
int maxx=0;
for(i=0;i<n;i++)
{
cnt=(upper_bound(a,a+n,a[i])-lower_bound(a,a+n,a[i]));

if(cnt>maxx) maxx=cnt;
}
printf("%d\n",maxx);
}
return 0;
}

HDU 1800 Flying to the Mars,布布扣,bubuko.com

HDU 1800 Flying to the Mars

原文:http://www.cnblogs.com/sola1994/p/3923653.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!