Wrong Answer
Code
#include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
string s;
cin >> s;
char pv = '\0';
int count = 0, maxm = 0, maxe = 0;
for (char c : s) {
if (c == 'M' || c == 'E') {
if (c == pv) {
count++;
} else {
pv = c;
count = 1;
}
if (c == 'M') {
maxm = max(maxm, count);
} else if (c == 'E') {
maxe = max(maxe, count);
}
} else {
pv = '\0';
count = 0;
}
}
if (maxe>maxm){
cout<<"Emon"<<endl;
}else if(maxm>maxe){
cout<<"Mahfuz"<<endl;
}else{
cout<<"IDK"<<endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1031 Clash of programmers
- Contest
- Brain booster #2
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-03-06 15:56:11
- Judged At
- 2024-11-11 03:41:29
- Judged By
- Score
- 0
- Total Time
- 1ms
- Peak Memory
- 536.0 KiB