--hdu 1800 Flying to the Mars(贪心)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1800

Ac code:
#include<stdio.h>
#include<stdlib.h>
int cmp(const void *a,const void *b)
{
return *(int *)a-*(int *)b;
}
int main(void)
{
int n,i,ma,t;
int a[3005];
while(scanf("%d",&n)!=EOF)
{
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
qsort(a,n,sizeof(a[0]),cmp);
ma=1;t=1;
for(i=1;i<n;++i)
{
if(a[i]!=a[i-1])
t=1;
else
++t;
ma=t>ma?t:ma;
}
printf("%d\n",ma);
} return 0;
}
--hdu 1800 Flying to the Mars(贪心)的更多相关文章
- hdu 1800 Flying to the Mars
		
Flying to the Mars 题意:找出题给的最少的递增序列(严格递增)的个数,其中序列中每个数字不多于30位:序列长度不长于3000: input: 4 (n) 10 20 30 04 ou ...
 - HDU 1800——Flying to the Mars——————【字符串哈希】
		
Flying to the Mars Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Other ...
 - HDU - 1800  Flying to the Mars  【贪心】
		
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1800 题意 给出N个人的 level 然后 高的level 的 人 是可以携带 比他低level 的人 ...
 - HDU 1800 Flying to the Mars 字典树,STL中的map ,哈希树
		
http://acm.hdu.edu.cn/showproblem.php?pid=1800 字典树 #include<iostream> #include<string.h> ...
 - HDU 1800 Flying to the Mars Trie或者hash
		
http://acm.hdu.edu.cn/showproblem.php?pid=1800 题目大意: 又是废话连篇 给你一些由数字组成的字符串,判断去掉前导0后那个字符串出现频率最高. 一开始敲h ...
 - hdu 1800  Flying to the Mars(简单模拟,string,字符串)
		
题目 又来了string的基本用法 //less than 30 digits //等级长度甚至是超过了int64,所以要用字符串来模拟,然后注意去掉前导零 //最多重复的个数就是答案 //关于str ...
 - 杭电 1800 Flying to the Mars(贪心)
		
http://acm.hdu.edu.cn/showproblem.php?pid=1800 Flying to the Mars Time Limit: 5000/1000 MS (Java/Oth ...
 - HDOJ.1800 Flying to the Mars(贪心+map)
		
Flying to the Mars 点我挑战题目 题意分析 有n个人,每个人都有一定的等级,高等级的人可以教低等级的人骑扫帚,并且他们可以共用一个扫帚,问至少需要几个扫帚. 这道题与最少拦截系统有异 ...
 - HDOJ 1800 Flying to the Mars 盲目搜索......................so easy...........
		
check the original problem here:http://acm.hdu.edu.cn/showproblem.php?pid=1800 the AC code: #include ...
 
随机推荐
- 我的WCF摸爬滚打之路(2)
			
昨天抽空写了一个wcf的创建和宿主程序的创建文章,下面也有很多园友给了评论,在此谢谢大家给了我继续记录我的摸爬滚打之路信心……抱拳! 上次的文章<我的WCF摸爬滚打之路(1)>中写到,在测 ...
 - C# LUA 闭包
			
许多语言中有闭包的概念,C#的闭包以lambda表达式表现,可以实现与LUA完全一样的效果. //LUA------------------------------------------------ ...
 - HMAC-MD5算法原理及实现
			
以下是分析节选,对于更详细的描述可以查阅RFC2104文档. HMAC需要一个加密用散列函数(表示为H)和一个密钥K. 假设H是一个将数据块用一个基本的迭代压缩函数来加密的散列函数. 用B来表 ...
 - Asp.net Json数据解析的一种思路
			
在日常的编码中,经常会遇到JSON类型的数据,有简单的,也有复杂的.对于简单的,我们可以用正则等匹配,但是一旦遇到复杂的,就比较难办了. 数据分析 目前手头上需要制作一个天气预报功能,现成的接口已经有 ...
 - ios —— UIViewAdditions 布局坐标类库
			
方便大家计算视图的高度,宽度,上下左右坐标,简化代码操作,更加直观 下载地址:http://download.csdn.net/detail/humingtao2013/7511657
 - 【WEB API项目实战干货系列】- 接口文档与在线测试(二)
			
上一篇: [WEB API项目实战干货系列]- Web API 2入门(一) 这一篇我们主要介绍如何做API帮助文档,给API的调用人员介绍各个 API的功能, 输入参数,输出参数, 以及在线测试 A ...
 - 『片段』C# DateTime 时间相减 和 时区的关系
			
本文只是基础代码片段,直接先写 结论: C# DateTime 时间相减 —— 和 时区无关,只和时间值有关. 运行结果: 测试代码: using System; using System.Colle ...
 - 深入JVM系列之(3):JavaCore和HeapDump
			
jvm 生成javacore和heapdump文件 在Server端开发与运维中,经常需要生成javacore和heapdump文件,以便分析jvm的运行状态.javacore文件中给出jvm线程的详 ...
 - spring cloud教程之使用spring boot创建一个应用
			
<7天学会spring cloud>第一天,熟悉spring boot,并使用spring boot创建一个应用. Spring Boot是Spring团队推出的新框架,它所使用的核心技术 ...
 - 打个酱油,欢迎指正FizzBuzzWhizz(c#)
			
平民的代码,列表法,凑个热闹,做了简单的测试,太晚了就不写测试用例了 using System; using System.Collections.Generic; using System.Linq ...