/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 0ms 284.0 KiB
#2 Wrong Answer 0ms 324.0 KiB

Code

#include <stdio.h>

void Final_Sequence(int k) {
    char sequence[3] = {'B', 'G', 'R'};

    for (int i = 0; i < k; i++) {
        // Perform the operations separately
        char initial = sequence[0];
        sequence[0] = sequence[1];
        sequence[1] = sequence[2];
        sequence[2] = initial;
    }

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

int main() {
    int T;

    // Taking user input for the number of test cases
    scanf("%d", &T);

    for (int i = 1; i <= T; i++) {
        int k;

        // Taking user input for the number of operations for each test case
        printf("\n%d: ", i);
        scanf("%d", &k);

        Final_Sequence(k);
    }

    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 15:52:01
Judged At
2024-11-11 03:45:22
Judged By
Score
0
Total Time
0ms
Peak Memory
324.0 KiB