HDU1800 Flying to the Mars 【贪心】】的更多相关文章

Flying to the Mars Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10854    Accepted Submission(s): 3481 Problem Description In the year 8888, the Earth is ruled by the PPF Empire . As the popu…
Flying to the Mars Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11228    Accepted Submission(s): 3619 Problem Description In the year 8888, the Earth is ruled by the PPF Empire . As the popul…
题目链接: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",&…
Flying to the Mars Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 22086    Accepted Submission(s): 7091     Problem Description     In the year 8888, the Earth is ruled by the PPF Empire . As…
http://acm.hdu.edu.cn/showproblem.php?pid=1800 Flying to the Mars Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10798    Accepted Submission(s): 3461 Problem Description In the year 8888, the…
Flying to the Mars 点我挑战题目 题意分析 有n个人,每个人都有一定的等级,高等级的人可以教低等级的人骑扫帚,并且他们可以共用一个扫帚,问至少需要几个扫帚. 这道题与最少拦截系统有异曲同工之妙.不同在于这道题可以排序,而最少拦截系统不能排序.我们想一下,把这些人排好序,并统计每个等级的人的个数.一次从最高等级到最低等级划掉一个人(可以理解为这些人互相教并且骑一个扫帚),一直划,直到最后一个人.这样可以看出来,扫帚的数量肯定是由某个等级的人数确定的.并且那个等级的人数最多.因此,…
Flying to the Mars 题意:找出题给的最少的递增序列(严格递增)的个数,其中序列中每个数字不多于30位:序列长度不长于3000: input: 4 (n) 10 20 30 04 output 1 思路:将节目转化为相同数的最多个数即可~~ 这时就随便怎么搞了.我是直接用了map(开始不会hash啊…)来找mx; 但是和字符串hash相比,时间性能不好. 之后看了ACdreamers,学习了ELFhash之后发现挺好用的~~下面将讲解一下我对ELFhash的理解. // 702m…
D - Flying to the Mars Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1800 Description In the year 8888, the Earth is ruled by the PPF Empire . As the population growing , PPF needs to find mor…
Flying to the Mars Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16049    Accepted Submission(s): 5154 Problem Description In the year 8888, the Earth is ruled by the PPF Empire . As the popul…
题意: 给你N个数字,带前导0,问出现最多的数字个数 思路: 读入,清楚前导0,Hash. 用邻接表字符串Hash有一下几点注意 string,不要memset,否则地址也没了,涉及到stl的东西,少用memset,类似还有vector; 用 assign截断字符串也是很黄很暴力的 直接assign(a.begin(),a.end) 即可 其实这种算法跟MAP 也没什么两样了...字符串HASH的更强大地方在于后缀的随机算法,这里不要过于纠结 而且MAP 效率高的多... #include <c…