Accepted
Code
#include <stdio.h>
int main() {
int T;
scanf("%d", &T);
while (T--) {
int K;
scanf("%d", &K);
int mod = K % 6; // cycle repeats every 6 operations
// Predefined states for mod 0 to 5
char *results[] = {"RGB", "GRB", "GBR", "BGR", "BRG", "RBG"};
printf("%s\n", results[mod]);
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1010 Red Green Blue
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2025-05-21 09:46:25
- Judged At
- 2025-05-21 09:46:25
- Judged By
- Score
- 100
- Total Time
- 3ms
- Peak Memory
- 320.0 KiB