hdu---(5038)Grade(胡搞)】的更多相关文章

Description 题目描述 Ted is a employee of Always Cook Mushroom (ACM). His boss Matt gives him a pack of mushrooms and ask him to grade each mushroom according to its weight. Suppose the weight of a mushroom is w, then it’s grade s is s = 10000 - (100 - w…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5038 解题报告:就是输入n个数w,定义s = 10000 - (100 - w)^2,问s出现频率最高的是哪些,当所有的不同的s出现频率相同时,输出Bad Mushroom,当s只有一种时,直接输出. #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using n…
解题思路:这题最关键的是要读懂题意,If not all the value are the same but the frequencies of them are the same, there is no mode.这句话是至关重要 的一句.意思是:如果不是所有的值是相同的,并且他们的出现次数是相同的,那么就没有模型.如,1 1 2 2 3 3 ,它们并不是所有的数都是相同的的, 并且1出现2次,2出现2次,3出现2次,所以这组数据是没有模型的,同理,1 2 3 4 5 也是没有模型的,输…
题意:给 n 个数,输出众数,但是如果所有的频率都相同但数不同输出 Bad Mushroom. 析:直接记录个数直接暴力就,就是要注意只有一种频率的时候. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #include…
设串C的第一个字母在串A中出现的位置是stA, 串C的最后一个字母在串A中出现的位置是edA. 设串C的第一个字母在串B中出现的位置是stB, 串C的最后一个字母在串B中出现的位置是edB. 求出每一对合法的(stA, edA),(stB, edB) 对每一组( stA[i], edA[i] ) 和 ( stB[j], ed[j] ), 求串A[0,stA[i]-1]和串B[0, stB[j]-1]的最长公共子序列长度L1, 求串A[edA[i]+1, lenA-1]和串B[stB[j]+1,…
EBCDIC Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 160    Accepted Submission(s): 81 Problem Description A mad scientist found an ancient message from an obsolete IBN System/360 mainframe.…
343. Integer Break Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get. For example, given n = 2, return 1 (2 = 1 + 1); given n = 10, r…
新题目大意: 三个棋子按照先后顺序,可以随意方向合法地走到空位置上(而不是像原题light oj-1055中的一样三个棋子每次走的方向都一致),当三个棋子全部走进目标地点,就结束:求需要指挥的最少次数. 思路: BFS 在每次进行指挥时,需要分别指挥三个棋子,每个棋子至多有五种走法(第五种为原地不动——因为前进时受阻没法动的时候),同时枚举三个棋子的当前位置进入队列中.由于每个棋子在走的时候会影响到后续的点的移动,故需要三重for循环来枚举每次三个点的移动先后顺序,然后依旧三重循环来枚举搞定三个…
http://acm.hdu.edu.cn/showproblem.php?pid=5038 模拟水题 求出现次数最多的grade.如果有多个grade出现的次数一样多,且还有其他的grade,则把这些出现次数最多的grade按升序输出:否则,输出"Bad Mushroom". #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include…
Grade Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 109    Accepted Submission(s): 63 Problem Description Ted is a employee of Always Cook Mushroom (ACM). His boss Matt gives him a pack of m…