check the original problem here:http://acm.hdu.edu.cn/showproblem.php?pid=1800 the AC code: #include<iostream> #include<cstring> #include<algorithm> #include<cmath> #include<map> #include<cstdio> using namespace std; in…
Flying to the Mars 点我挑战题目 题意分析 有n个人,每个人都有一定的等级,高等级的人可以教低等级的人骑扫帚,并且他们可以共用一个扫帚,问至少需要几个扫帚. 这道题与最少拦截系统有异曲同工之妙.不同在于这道题可以排序,而最少拦截系统不能排序.我们想一下,把这些人排好序,并统计每个等级的人的个数.一次从最高等级到最低等级划掉一个人(可以理解为这些人互相教并且骑一个扫帚),一直划,直到最后一个人.这样可以看出来,扫帚的数量肯定是由某个等级的人数确定的.并且那个等级的人数最多.因此,…
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 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…
题目链接: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",&…
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): 11228 Accepted Submission(s): 3619 Problem Description In the year 8888, the Earth is ruled by the PPF Empire . As the popul…
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…
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…
hdu_1800 简单排一下序,从大开始把比他小的都访问一遍,ans++: #include <iostream> #include <stdio.h> #include <algorithm> using namespace std; struct dat { int level; int visit; }data[]; bool cmp(dat a, dat b) { return a.level > b.level; } int main() { int n…
链接: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): 10830 Accepted Submission(s): 3472 Problem Description In the year 8888, t…
HDU 1000 A + B Problem I/O HDU 1001 Sum Problem 数学 HDU 1002 A + B Problem II 高精度加法 HDU 1003 Maxsum 贪心 HDU 1004 Let the Balloon Rise 字典树,map HDU 1005 Number Sequence 求数列循环节 HDU 1007 Quoit Design 最近点对 HDU 1008 Elevator 模拟 HDU 1010 Tempter of th…
Flying to the Mars Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18240 Accepted Submission(s): 5877 Problem Description In the year 8888, the Earth is ruled by the PPF Empire . As the popul…
FatMouse' Trade Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 56784 Accepted Submission(s): 19009 Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats g…
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3049 Accepted Submission(s): 2364 Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of…
Box of Bricks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5994 Accepted Submission(s): 2599 Problem Description Little Bob likes playing with his box of bricks. He puts the bricks one up…