hiho week 187 register

Ended

Participants:129

Verdict:Accepted
Score:100 / 100
Submitted:2018-01-27 20:48:17

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
*   Copyright (C) 2016 All rights reserved.
*   
*   filename: d.cpp
*   author: doublehh
*   e-mail: sserdoublehh@foxmail.com
*   create time: 2016-08-07 13:46:23
*   last modified: 2016-08-07 13:46:23
*/
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5;
int n;
int a[N];
map<int, int> cnt;
set< pair<int, int> > S;
vector<int> vec;
int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
        cnt[a[i]]++;
    }
    for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); it++)
        S.insert(make_pair(it->second, it->first));
    if ((--S.end())->first * 2 - 1 > n)
    {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX