首页 > 其他 > 详细

hdu-1029-Ignatius and the Princess IV

时间:2018-04-25 10:45:09      阅读:184      评论:0      收藏:0      [点我收藏+]

 

题目链接

 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

原文:https://www.cnblogs.com/evidd/p/8940711.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!