/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 16ms 2.965 MiB
#2 Wrong Answer 15ms 3.125 MiB

Code

def find_winner(N, rounds):
    mahfuz_points = 0
    emon_points = 0
    k = 0
    
    for round_result in rounds:
        if round_result == 'M':
            mahfuz_points += 1
        elif round_result == 'E':
            emon_points += 1
        else:  # round_result == '?'
            k += 1
        
        if mahfuz_points >= k and mahfuz_points >= emon_points:
            return "Mahfuz"
        elif emon_points >= k and emon_points > mahfuz_points:
            return "Emon"
    
    return "IDK"

def main():
    N = int(input("Enter the number of rounds: "))
    rounds = input("Enter the results of each round: ").strip()
    
    winner = find_winner(N, rounds)
    print(winner)

if __name__ == "__main__":
    main()

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:52:27
Judged At
2024-11-11 03:41:31
Judged By
Score
0
Total Time
16ms
Peak Memory
3.125 MiB