/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 324.0 KiB
#3 Time Exceeded ≥1100ms ≥544.0 KiB
#4 Accepted 4ms 548.0 KiB
#5 Accepted 25ms 532.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){
                char temp;
                temp=pens[1];
                pens[1]=pens[0];
                pens[0]=temp;
            }
            else{
                char temp;
                temp=pens[1];
                pens[1]=pens[2];
                pens[2]=temp;
                
            }
        }
        cout << pens << endl;
}
int main() {
    int T;
    cin >> T;
    while (T--) {
        int k;
        cin >> k;
        solve(k);
        
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1010 Red Green Blue
Contest
Brain booster - 1
Language
C++17 (G++ 13.2.0)
Submit At
2023-12-31 15:07:50
Judged At
2024-10-03 14:06:46
Judged By
Score
80
Total Time
≥1100ms
Peak Memory
≥548.0 KiB