/ SeriousOJ /

Record Detail

Accepted


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

Code


#include <vector>
#include <iostream>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  vector<string> a(6);
  a[0] = "RGB";
  for (int i = 1; i < 6; i++) {
    a[i] = a[i - 1];
    if (i & 1) {
      swap(a[i][0], a[i][1]);
    } else {
      swap(a[i][2], a[i][1]);
    }
  }
  int tt;
  cin >> tt;
  for (int tc = 1; tc <= tt; tc++) {
    int n;
    cin >> n;
    cout << a[n % 6] << '\n';
  }
  return 0;
}
 

Information

Submit By
Type
Submission
Problem
P1010 Red Green Blue
Language
C++20 (G++ 13.2.0)
Submit At
2024-05-06 21:29:26
Judged At
2024-05-06 21:29:26
Judged By
Score
100
Total Time
1ms
Peak Memory
540.0 KiB