Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define pb push_back
- #define pf push_front
- #define mp make_pair
- #define sz size
- #define ll long long
- #define ld long double
- #define fs first
- #define sc second
- #define forn(i, f, t) for(int i = f; i < t; i++)
- #define all(x) (x).begin(), (x).end()
- #define ins insert
- const int INF = 2147483647;
- const int MOD = 1000000007;
- const ll INF64 = 9223372036854775807;
- const ld EPS = 1e-7;
- using namespace std;
- map<int, int> a;
- int main(){
- int n, maxn = 0, maxi = 0, t;
- scanf("%d", &n);
- forn(i, 0, n){
- scanf("%d", &t);
- ++a[t];
- if (a[t] > maxn){
- maxn = a[t];
- maxi = t;
- }
- }
- printf("%d\n", maxi);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement