Advertisement
PikMike

Untitled

Mar 13th, 2016
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define pb push_back
  4. #define pf push_front
  5. #define mp make_pair
  6. #define sz size
  7. #define ll long long
  8. #define ld long double
  9. #define fs first
  10. #define sc second
  11. #define forn(i, f, t) for(int i = f; i < t; i++)
  12. #define all(x) (x).begin(), (x).end()
  13. #define ins insert
  14.  
  15. const int INF = 2147483647;
  16. const int MOD = 1000000007;
  17. const ll INF64 = 9223372036854775807;
  18. const ld EPS = 1e-7;
  19.  
  20. using namespace std;
  21.  
  22. map<int, int> a;
  23.  
  24.  
  25. int main(){
  26.     int n, maxn = 0, maxi = 0, t;
  27.     scanf("%d", &n);
  28.     forn(i, 0, n){
  29.         scanf("%d", &t);
  30.         ++a[t];
  31.         if (a[t] > maxn){
  32.             maxn = a[t];
  33.             maxi = t;
  34.         }
  35.     }
  36.     printf("%d\n", maxi);
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement