Sample Input5 //Tgreenredblueredred 统计颜色的次数 输出最多的颜色3pinkorangepink0 Sample Outputred pink # include <iostream> # include <cstdio> # include <cstring> # include <string> # include <map> using namespace std ; int main () { // f…
HDU 1029 Ignatius and the Princess IV (思维题,排序?) Description "OK, you are not too bad, em... But you can never pass the next test." feng5166 says. "I will tell you an odd number N, and then N integers. There will be a special integer among t…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1029 Ignatius and the Princess IV Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32767 K (Java/Others)Total Submission(s): 42359 Accepted Submission(s): 18467 Problem Description "OK, y…
此题无法用JavaAC,不相信的可以去HD1029题试下! Problem Description "OK, you are not too bad, em- But you can never pass the next test." feng5166 says. "I will tell you an odd number N, and then N integers. There will be a special integer among them, you hav…
传送门:Ignatius and the Princess IV 题意:给n个数,找出出现次数大于等于(n+1)/2的那个数. 分析:大水题,排个序输出中间那个即可,这里随便写个HASHMAP找出次数最大那个. #include <algorithm> #include <cstdio> #include <cstring> #define N 1000010 #define inf 0x3f3f3f3f using namespace std; ; ; struct…
Ignatius and the Princess IV Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32767 K (Java/Others)Total Submission(s): 27227 Accepted Submission(s): 11562 Problem Description "OK, you are not too bad, em... But you can never pass the…