/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 0ms 324.0 KiB
#2 Accepted 0ms 284.0 KiB
#3 Time Exceeded ≥1096ms ≥420.0 KiB
#4 Accepted 1ms 324.0 KiB
#5 Accepted 9ms 424.0 KiB

Code

#include<stdio.h>

int main(){

	int n, i, j;    char temp;

    scanf("%d", &n);

    int a[n];

    for(i=0;i<n;i++){

    	scanf("%d", &a[i]);

    }

    for(i=0;i<n;i++){

    	char ch[3]="RGB";

    	for(j=1;j<=a[i];j++){

        	if(j%2==1){

            	temp=ch[0];

                ch[0]=ch[1];

                ch[1]=temp;

            }

            else if(j%2==0){

            	temp=ch[2];

                ch[2]=ch[1];

                ch[1]=temp;

            }

        }

        printf("%c%c%c\n", ch[0],ch[1],ch[2]);

    }

	return 0;

}

Information

Submit By
Type
Submission
Problem
P1010 Red Green Blue
Contest
Brain booster - 1
Language
C99 (GCC 13.2.0)
Submit At
2023-12-31 16:42:57
Judged At
2024-11-11 03:45:02
Judged By
Score
80
Total Time
≥1096ms
Peak Memory
≥424.0 KiB