-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path585D
36 lines (34 loc) · 794 Bytes
/
585D
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//I_love_StarnyC
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define f first
#define s second
#define pb push_back
#define fix cout<<std::fixed;
#define mk make_pair
#define mod 1000000007
#define time cerr<< '\n' << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n" ;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{ IOS
ll n;cin>>n;ll sum=0;ll t;
ll l=0,r=0;
string s;cin>>s;
for(int i=0;i<s.length()/2;i++)
{
if(s[i]!='?')sum+=(s[i]-'0');
else l++;
}
for(int i=s.length()/2;i<s.length();i++)
{
if(s[i]!='?')sum-=(s[i]-'0');
else r++;
}
t= abs(l-r);
if(l<r)sum*=-1;
ll u=9*t/2;
if((sum+u)!=0)cout<<"Monocarp"<<endl;
else cout<<"Bicarp"<<endl;
}