IMohammedNasr

A. Playing With Teams

Sep 24th, 2022
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.37 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <ext/pb_ds/assoc_container.hpp>
  3. #include <ext/pb_ds/tree_policy.hpp>
  4. using namespace __gnu_pbds;
  5. using namespace std;
  6. #define cin(v) for (auto &i : v) cin >> i;
  7. #define cout(v) for (auto &i : v) cout << i << " "; cout<<'\n';
  8. #define ll long long
  9. #define all(v) v.begin(), v.end()
  10. #define rall(v) v.rbegin(), v.rend()
  11. #define MOD 1000000007
  12. #define Ceil(a,b) a / b + (a % b != 0)
  13. #define Time cerr << "Time Taken: " << (float)clock() / CLOCKS_PER_SEC << " Secs"<< "\n";
  14. #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
  15. #define multi_ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
  16.  
  17. void Warding()
  18. {
  19.     ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  20. #ifndef ONLINE_JUDGE
  21.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  22. #endif
  23. }
  24.  
  25. /*
  26. STOP USING int  
  27. */
  28.  
  29.  
  30.  
  31. void solve(){
  32.     int n, Nasr = 0 , Memo = 0; cin>>n;
  33.     vector<int> v(n); cin(v);
  34.     for(int i = n/2, j = 0; i < n; i++,j++){
  35.         Nasr += (v[i] > v[j]);
  36.         Memo +=(v[j] > v[i]);
  37.     }
  38.     if(Nasr == Memo) return void(cout<<-1<<endl);
  39.     cout<<(Nasr > Memo ? "Nasr" : "MeMo")<<endl;
  40. }
  41.  
  42. int main()
  43. {
  44.     Warding();
  45.     int TC = 1;
  46.     // cin >> TC;
  47.     while (TC--)
  48.     {
  49.         solve();
  50.     }
  51.     Time
  52. }
Advertisement
Add Comment
Please, Sign In to add comment