B. Cards:题目
竟然需要按照顺序输出,淦!
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll> a((int)6e5);
vector<ll> b((int)6e5);
string str;
int main()
{int a = 0, b = 0, c = 0;int n;cin >> n;cin >> str;for (int i = 0; i < n; i++){if (str[i] == 'G')a++;else if (str[i] == 'R')b++;elsec++;}int cou = 0;if (a)cou++;if (b)cou++;if (c)cou++;if (cou == 1){if (a)cout << 'G';else if (b)cout << 'R';elsecout << 'B';}else if (cou == 2){if (a && b){cout << 'B';if (b > 1)cout << 'G';if (a > 1)cout << 'R';}if (a && c){if (a > 1)cout << 'B';if (c > 1)cout << 'G';cout << 'R';}if (b && c){if (b > 1)cout << 'B';cout << 'G';if (c > 1)cout << 'R';}}elsecout << "BGR";
}