Facebook
From sohag hossain, 1 Month ago, written in C++.
Embed
Download Paste or View Raw
Hits: 173
  1. // In the name of Allah
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4. #define endl "n"
  5.  
  6. int32_t main() {
  7.   #ifndef ONLINE_JUDGE
  8.   freopen("input.txt", "r", stdin);
  9.   freopen("output.txt", "w", stdout);
  10.   #endif
  11.   ios_base::sync_with_stdio(0);
  12.   cin.tie(0);
  13. /*
  14. int t;
  15. cin>>t;
  16.  
  17.   while(t--){
  18.    long long n;
  19.    cin>>n;
  20.  
  21.    vector<long long >v(n);
  22.  
  23.    for(int i=0; i<n; i++){
  24.     cin>>v[i];
  25.    }
  26.  
  27.    sort(v.begin(),v.end());
  28.  
  29.  
  30.    long long mid,cnt=0;
  31.  
  32.    mid = (n-1)/2;
  33.  
  34.  
  35.    for(int i=mid; i<n; i++){
  36.     if(v[mid] == v[i]){
  37.      cnt++;
  38.     }else{
  39.      break;
  40.     }
  41.    }
  42.  
  43.    cout<<cnt<<endl;
  44.  
  45.   }
  46. */
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.   return 0;
  54. }