/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 1ms 540.0 KiB
#3 Accepted 2ms 516.0 KiB
#4 Accepted 2ms 484.0 KiB
#5 Accepted 2ms 540.0 KiB

Code

#include <iostream>
#include <string>
using namespace std;
void solve(int k){
    string pens="RGB";
    for(int i=0; i<k; i++){
        if(i%2==0){
            swap(pens[0],pens[1]);
        }
        else{
            swap(pens[1],pens[2]);
        }}
        cout<<pens<<endl;
}
int main() {
    long long int T;
    cin >> T;
    while (T--) {
        int k;
        cin >> k;
        k=k%6;
        solve(k);
        
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1010 Red Green Blue
Language
C++20 (G++ 13.2.0)
Submit At
2024-01-01 16:02:30
Judged At
2024-01-01 16:02:30
Judged By
Score
100
Total Time
2ms
Peak Memory
540.0 KiB