zoukankan      html  css  js  c++  java
  • CodeForces 626B Cards

    瞎搞题。。。凭直觉+猜测写了一发,居然AC了。。

    #include<cstdio>
    #include<cstring>
    #include<cmath>
    #include<string>
    #include<vector>
    #include<queue>
    #include<algorithm>
    #include<iostream>
    using namespace std;
    
    char s[200+10];
    int n;
    int R,G,B;
    
    int main()
    {
        scanf("%d",&n);
        scanf("%s",s);
        for(int i=0;s[i];i++)
        {
            if(s[i]=='R') R++;
            if(s[i]=='G') G++;
            if(s[i]=='B') B++;
        }
    
        if(R&&G==0&&B==0) printf("R
    ");
        else if(R==0&&G&&B==0) printf("G
    ");
        else if(R==0&&G==0&&B) printf("B
    ");
        else if(B==1&&G==1&&R==0) printf("R
    ");
        else if(B==1&&G==0&&R==1) printf("G
    ");
        else if(B==0&&G==1&&R==1) printf("B
    ");
    
        else if(B==1&&G>1&&R==0) printf("BR
    ");
        else if(B==1&&G==0&&R>1) printf("BG
    ");
        else if(B==0&&G==1&&R>1) printf("BG
    ");
        else if(B>1&&G==1&&R==0) printf("GR
    ");
        else if(B==0&&G>1&&R==1) printf("BR
    ");
        else if(B>1&&G==0&&R==1) printf("GR
    ");
    
        else printf("BGR
    ");
        return 0;
    }
  • 相关阅读:
    Fiddler基础与HTTP状态码
    Fiddler与F12设置代理
    人和机器猜拳游戏
    ng-model 取不到值
    git的使用
    笔记
    INSPIRED启示录 读书笔记
    INSPIRED启示录 读书笔记
    INSPIRED启示录 读书笔记
    INSPIRED启示录 读书笔记
  • 原文地址:https://www.cnblogs.com/zufezzt/p/5203475.html
Copyright © 2011-2022 走看看