Accepted
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-11-11 03:37:58
- Judged By
- Score
- 100
- Total Time
- 1ms
- Peak Memory
- 764.0 KiB