码迷,mamicode.com
首页 > 其他好文 > 详细

hdu-1029-Ignatius and the Princess IV

时间:2018-04-25 10:54:30      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:font   namespace   cst   algo   scan   and   size   freopen   author   

 

题目链接

 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

标签:font   namespace   cst   algo   scan   and   size   freopen   author   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!