/ SeriousOJ /

Record Detail

Accepted


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

Code

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

int main() {

	int x,i;
	cin>>x;
	for(i=0;i<x;i++)
    {
        char s[1000];
        int count1=0,count2=0;
        cin>>s;
        for(int j=0;s[j]!='\0';j++)
        {
            if(s[j]=='p'){
                count1++;
        }
            else if(s[j]=='q'){
                count2++;
            }
        }
        if(count1>count2) cout<<"Roy"<<endl;
        else if(count1<count2) cout<<"Mahfuj"<<endl;
        else cout<<"Draw"<<endl;
    }


}

Information

Submit By
Type
Submission
Problem
P1040 Character game
Contest
TLE_Headquarters - round #1
Language
C++17 (G++ 13.2.0)
Submit At
2024-03-27 16:51:52
Judged At
2024-03-27 16:51:52
Judged By
Score
100
Total Time
1ms
Peak Memory
540.0 KiB