626B. Cards
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                626B. Cards
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.                        
                                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"; }總結(jié)
以上是生活随笔為你收集整理的626B. Cards的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
                            
                        - 上一篇: 2020下半年软考 软件设计师通过感言
 - 下一篇: angular --- ngDialo