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;
    }
  • 相关阅读:
    Windsor
    .net 常见异常及其翻译
    nginx
    数据库访问层封装
    web api HttpConfiguration
    ENode, 领域模型,DDD
    缓存 Redis
    win7 快捷键
    visual studio 快捷键
    c# 正则表达式
  • 原文地址:https://www.cnblogs.com/zufezzt/p/5203475.html
Copyright © 2011-2022 走看看