码迷,mamicode.com
首页 > 其他好文 > 详细

HDU 1800 Flying to the Mars

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

标签:os   io   数据   for   ar   代码   amp   size   

可能是数据水吧

看到网上的代码都是什么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

标签:os   io   数据   for   ar   代码   amp   size   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!