/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 284.0 KiB
#2 Accepted 1ms 284.0 KiB
#3 Accepted 1ms 284.0 KiB

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