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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
| #include <iostream> // standard input & output cout cin#include <cstdio> // scanf printfsssss#include <vector> // std::vector#include <algorithm>#include <string> // std::string#include <queue> // std::queue#include <cstring> // memset#include <set> // std::set#include <utility> // std::pair, std::make_pair#include <map>#include <list>#include <stack>#include <deque>#include <cmath>#include <climits>#include <cassert>using namespace std;#define fi first#define se second#define mp make_pair#define pb push_backtypedef long long ll;typedef pair<ll, ll> ii;typedef vector<int> vi;typedef long double ld;#define mod 1000000007const char newline = '\n';ll powmod(ll a, ll b) {ll res=1; a %= mod; assert(b >= 0); for(; b; b >>= 1) {if (b & 1) res = res * a % mod; a = a * a % mod;} return res;}int main(int argc, char **argv){ ios_base::sync_with_stdio(false); cin.tie(0); int n; map<long long int , int> mm; cin>>n; while(n--) { long long t; cin>>t; if(mm.count(t) == 0) mm[t] = 1; else mm[t] += 1; } pair<long long int, int> answer = {-1,0}; for(auto i : mm) { if(answer.se < i.se) { answer = i; } } cout<<answer.fi<<newline; return 0;}long long int 의 저주 |