fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <set>
  5. #include <queue>
  6. #include <map>
  7. #include <stack>
  8. #include <algorithm>
  9. #include <cstring>
  10. #include <cmath>
  11. #include <cstdlib>
  12. #include <cstdio>
  13. #include <iomanip>
  14.  
  15. #define F first
  16. #define S second
  17. #define ll long long
  18. #define len length()
  19. #define sqr(x) x*x
  20. #define pb push_back
  21. #define mp make_pair
  22. #define sz(x) ((int) (x).size())
  23. #define all(x) x.begin(), x.end()
  24. #define allr(x) x.rbegin(), x.rend()
  25. #define bp(x) __builtin_popcount(x)
  26. #define INF numeric_limits<long long int>::max()
  27. #define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  28. #define frp freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
  29. #define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it++)
  30.  
  31. const int maxn = (int)1e6;
  32. const int mod = (int)1e9 + 7;
  33.  
  34. using namespace std;
  35.  
  36. int n;
  37.  
  38. vector<int>v;
  39.  
  40. int main(){
  41. scanf("%d",&n);
  42. for(int i=0; i < n; i++){
  43. int x; scanf("%d",&x);
  44. v.pb(x);
  45. }
  46. sort(all(v));
  47. printf("%d\n",v[n/2]);
  48.  
  49. return 0;
  50. }
  51.  
Runtime error #stdin #stdout 0s 3416KB
stdin
Standard input is empty
stdout
Standard output is empty