hdu-1029-Ignatius and the Princess IV

Posted 朤尧

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hdu-1029-Ignatius and the Princess IV相关的知识,希望对你有一定的参考价值。

 

题目链接

 1 /*
 2     Name:hdu-1029-Ignatius and the Princess IV
 3     Copyright:
 4     Author:
 5     Date: 2018/4/25 10:26:16
 6     Description:
 7     water,water
 8 */
 9 #include <iostream>
10 #include <cstdio>
11 #include <map>
12 #include <algorithm>
13 #include <utility>
14 using namespace std;
15 map<int ,int> capt;
16 bool cmp (pair<int, int> a, pair<int, int> b) {
17     return a.first < b.second;
18 }
19 int main()
20 {
21 //    freopen("in.txt", "r", stdin);
22     int n;
23     while (~scanf("%d", &n)) {
24         capt.clear();
25         while (n--) {
26             int tmp;
27             scanf("%d", &tmp);
28             capt[tmp]++;
29         }
30         printf("%d\n", max_element(capt.begin(), capt.end(), cmp)->first);
31     }
32     return 0;
33 }

 

以上是关于hdu-1029-Ignatius and the Princess IV的主要内容,如果未能解决你的问题,请参考以下文章

[2016-03-27][HDU][1029][Ignatius and the Princess IV]

HDU 1029: Ignatius and the Princess IV

HDU 1029 Ignatius and the Princess IV

HDU 1029 Ignatius and the Princess IV

hdu-1029-Ignatius and the Princess IV

HDU 1029 Ignatius and the Princess IV (map的使用)