Time Exceeded
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]);
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 17:01:00
- Judged At
- 2024-11-11 03:44:53
- Judged By
- Score
- 80
- Total Time
- ≥1038ms
- Peak Memory
- ≥424.0 KiB