Accepted
Code
#include <stdio.h>
#include <string.h>
int main()
{
int i,j,pc,qc,tc;
char string[100];
scanf("%d",&tc);
for (j = 1; j <= tc; j++){
pc=0;
qc=0;
scanf("%s", string);
int length = strlen(string);
for (i = 0; i < length; i++)
{
if (string[i] == 'p')
{
pc++;
}
else if (string[i] == 'q')
{
qc++;
}
}
if (pc>qc){printf("Roy\n");}
else if (qc>pc){printf("Mahfuj\n");}
else {printf("Draw\n");}
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1040 Character game
- Contest
- TLE_Headquarters - round #1
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2024-03-27 17:43:32
- Judged At
- 2024-11-11 03:37:28
- Judged By
- Score
- 100
- Total Time
- 1ms
- Peak Memory
- 284.0 KiB