/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 328.0 KiB
#2 Accepted 2ms 328.0 KiB
#3 Accepted 2ms 540.0 KiB

Code

#include<bits/stdc++.h>  
using namespace std;

int main() {
    int T;
    cin >> T;

    while (T--)
    {
        string S;
        cin >> S;
        int count_p=0,count_q=0;

        for(char chars : S){
            if (chars == 'p') count_p++;
            if (chars == 'q') count_q++;
        }
        if (count_p > count_q) {
            cout << "Roy\n";
        } else if (count_q > count_p) {
            cout << "Mahfuj\n";
        } else {
            cout << "Draw\n";
        }
    }
    
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1040 Character game
Contest
TLE_Headquarters - round #1
Language
C++20 (G++ 13.2.0)
Submit At
2024-03-27 16:47:45
Judged At
2024-11-11 03:38:04
Judged By
Score
100
Total Time
2ms
Peak Memory
540.0 KiB