/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 16ms 3.035 MiB
#2 Wrong Answer 16ms 3.113 MiB
#3 Wrong Answer 15ms 3.016 MiB

Code

'''CODED BY mahmudulsakib2019
 DATE:-06/03/2024; TIME:-20:50pm
  BANGALDESH , SYLHET'''
n=int(input())
s=input()
count_M=0
count_N=0
for i in range(0,n-1):
    if(s[i]=="M"):
        if s[i+1]=="M":
            count_M+=2
            if count_M >=n:
                print("Mahfuz")
                break
            
        else:
            count_M+=1
            if count_M>=n:
                print("Mahfuz")
                break
    elif s[i]=="E":
        if s[i+1]=="E":
            count_N+=2
            if count_N>=n:
                print("Emon")
                break
        else:
            count_N+=1
            if count_N>=n:
                print("Emon")
                break
#print(count_N)
#print(count_M)
if count_N>count_M:
    print("Emon")
elif count_M>count_N:
    print("Mahfuz")
else:
    print("IDK")

    

Information

Submit By
Type
Submission
Problem
P1031 Clash of programmers
Contest
Brain booster #2
Language
Python 3 (Python 3.12.3)
Submit At
2024-03-06 15:18:55
Judged At
2024-11-11 03:41:41
Judged By
Score
20
Total Time
16ms
Peak Memory
3.113 MiB