Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include <ext/pb_ds/assoc_container.hpp>
- #include <ext/pb_ds/tree_policy.hpp>
- using namespace __gnu_pbds;
- using namespace std;
- #define cin(v) for (auto &i : v) cin >> i;
- #define cout(v) for (auto &i : v) cout << i << " "; cout<<'\n';
- #define ll long long
- #define all(v) v.begin(), v.end()
- #define rall(v) v.rbegin(), v.rend()
- #define MOD 1000000007
- #define Ceil(a,b) a / b + (a % b != 0)
- #define Time cerr << "Time Taken: " << (float)clock() / CLOCKS_PER_SEC << " Secs"<< "\n";
- #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
- #define multi_ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
- void Warding()
- {
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- /*
- STOP USING int
- */
- void solve(){
- int n, Nasr = 0 , Memo = 0; cin>>n;
- vector<int> v(n); cin(v);
- for(int i = n/2, j = 0; i < n; i++,j++){
- Nasr += (v[i] > v[j]);
- Memo +=(v[j] > v[i]);
- }
- if(Nasr == Memo) return void(cout<<-1<<endl);
- cout<<(Nasr > Memo ? "Nasr" : "MeMo")<<endl;
- }
- int main()
- {
- Warding();
- int TC = 1;
- // cin >> TC;
- while (TC--)
- {
- solve();
- }
- Time
- }
Advertisement
Add Comment
Please, Sign In to add comment