Time Exceeded
Code
#include <bits/stdc++.h>
using namespace std;
int main()
{
int tcase;
cin >> tcase;
string pen = "RGB";
while (tcase--)
{
int n, temp;
cin >> n;
for (int i = 1; i <= n; i++)
{
if (i % 2 != 0)
{
temp = pen[1];
pen[1] = pen[0];
pen[0] = temp;
}
else if (i % 2 == 0)
{
temp = pen[1];
pen[1] = pen[2];
pen[2] = temp;
}
}
cout << pen << endl;
pen = "RGB";
}
// cout << pen << endl;
}
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 13:50:41
- Judged At
- 2024-11-11 03:46:33
- Judged By
- Score
- 80
- Total Time
- ≥1077ms
- Peak Memory
- ≥580.0 KiB