fork download
  1. //Bai 18
  2.  
  3. #include<bits/stdc++.h>
  4. using namespace std;
  5. #define el "\n"
  6. #define ll long long
  7. #define ull unsigned long long
  8. #define se second
  9. #define fi first
  10. #define be begin()
  11. #define en end()
  12. #define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
  13. int n;
  14. unordered_map<int,int> mp;
  15. void Run()
  16. {
  17. cin >> n;
  18. int mid = (n + 1) / 2;
  19. while(n--)
  20. {
  21. int x; cin >> x;
  22. mp[x]++;
  23. if(n == mid) mid = x;
  24. }
  25. cout << mp[mid];
  26. }
  27. int main()
  28. {
  29. Faster;
  30. Run();
  31. return 0;
  32. }
  33.  
  34.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
Standard output is empty