Time Exceeded
Code
#include <iostream>
#include <string>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int k;
cin >> 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;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1010 Red Green Blue
- Contest
- Brain booster - 1
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2023-12-31 15:02:18
- Judged At
- 2024-11-11 03:46:02
- Judged By
- Score
- 80
- Total Time
- ≥1094ms
- Peak Memory
- ≥544.0 KiB