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

#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<iostream>
using namespace std; char s[+];
int n;
int R,G,B; int main()
{
scanf("%d",&n);
scanf("%s",s);
for(int i=;s[i];i++)
{
if(s[i]=='R') R++;
if(s[i]=='G') G++;
if(s[i]=='B') B++;
} if(R&&G==&&B==) printf("R\n");
else if(R==&&G&&B==) printf("G\n");
else if(R==&&G==&&B) printf("B\n");
else if(B==&&G==&&R==) printf("R\n");
else if(B==&&G==&&R==) printf("G\n");
else if(B==&&G==&&R==) printf("B\n"); else if(B==&&G>&&R==) printf("BR\n");
else if(B==&&G==&&R>) printf("BG\n");
else if(B==&&G==&&R>) printf("BG\n");
else if(B>&&G==&&R==) printf("GR\n");
else if(B==&&G>&&R==) printf("BR\n");
else if(B>&&G==&&R==) printf("GR\n"); else printf("BGR\n");
return ;
}

CodeForces 626B Cards的更多相关文章

  1. Codeforces 626B Cards(模拟+规律)

    B. Cards time limit per test:2 seconds memory limit per test:256 megabytes input:standard input outp ...

  2. Codeforces 999F Cards and Joy(二维DP)

    题目链接:http://codeforces.com/problemset/problem/999/F 题目大意:有n个人,n*k张卡牌,每个人会发到k张卡牌,每个人都有一种喜欢的卡牌f[i],当一个 ...

  3. Codeforces 830B - Cards Sorting 树状数组

    B. Cards Sorting time limit per test 1 second memory limit per test 256 megabytes input standard inp ...

  4. codeforces #364a Cards

    cf的a题没什么好说到,100的量级,每个人给2张牌,使每个人手中的牌点数相等.保证有一种分配方案. 对每个人,先计算出手中的牌的点数,然后循环两遍拿牌就可以.   A. Cards time lim ...

  5. Codeforces 701A. Cards(水)

    A. Cards time limit per test 1 second memory limit per test 256 megabytes input standard input outpu ...

  6. CodeForces 701A Cards

    直接看示例输入输出+提示 1. 统计所有数的和 sum,然后求 sum/(n/2) 的到一半数的平均值 6 1 5 7 4 4 3 ->1+5+7+4+4+3=24  分成3组 每组值为8 in ...

  7. Codeforces 1278F: Cards

    题目传送门:CF1278F. 题意简述: 有 \(n\) 个独立随机变量 \(x_i\),每个随机变量都有 \(p = 1/m\) 的概率取 \(1\),有 \((1-p)\) 的概率取 \(0\). ...

  8. CodeForces 830B - Cards Sorting

    将每个数字的位置存进该数字的vector中 原数组排个序从小到大处理,每次在vector里二分找到距离当前位置“最远”的位置(相差最大),更新答案 树状数组维护每个数字现在的位置和原位置之差 #inc ...

  9. codeforces 1278F - Cards(第二类斯特林数+二项式)

    传送门 解题过程: \(答案=\sum^n_{i=0}*C^i_n*{\frac{1}{m}}^i*{\frac{m-1}{m}}^{n-i}*i^k\) 根据第二类斯特林数的性质\(n^k=\sum ...

随机推荐

  1. EGL接口介绍-----Android OpenGL ES底层开发

    引自:http://www.cnitblog.com/zouzheng/archive/2011/05/30/74326.html EGL 是 OpenGL ES 和底层 Native 平台视窗系统之 ...

  2. Tinyxml封装类COperatorXml

    OperatorXml.h头文件 #ifndef _OPERATOR_XML_H_ #define _OPERATOR_XML_H_ #include <string> class TiX ...

  3. iOS项目架构 小谈

    层级结构,自底向上 持久层(File,Realm,SQLite)<==>网络层(相信每个公司都有自己的网络层吧)==>业务层(ViewModel)==>展示层(View,VC) ...

  4. [转]动态添加Fragments

    本章节翻译自<Beginning-Android-4-Application-Development>,如有翻译不当的地方,敬请指出. 原书购买地址http://www.amazon.co ...

  5. android 市场发布应用小结

    1:360平台发布应用 网址:http://dev.app.360.cn/ 2:腾讯应用宝 平台发布应用: 地址:http://op.open.qq.com/  (未审核通过的不能更新版本) 3:发布 ...

  6. C++调用java

    摘要: 1 java类生成c头文件和库文件 2 对于c/c++程序,启动时先启动jvm,然后获得对应的java类的对象和方法.然后正常使用. 最近正在做一个C/C++调用java的程序,这里说的调用j ...

  7. 教你用CSS代码写出的各种形状图形

    做网页设计时经常要用到各种形状的图形,对于规则的图形很简单,但是对于不规则的图形,一般我们都是用图片,今天就在这里教大家怎样用css代码写出各种规则不同的图形 1.正方形 #square {width ...

  8. 在web项目中使用cxf开发webservice,包含spring支持

    本文主要介绍了,如何使用cxf内置的例子,学会开发webserivce,在web项目中使用,且包含spring支持. webserivce的开发可以使用cxf或者axis,好像还有httpclient ...

  9. 剑指offer替换空格

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3 ...

  10. Linux 排除问题的前5分钟

    尽可能搞清楚问题的前因后果 不要一下子就扎到服务器前面,你需要先搞明白这台服务器有多少已知的情况,还有故障的具体情况,不然你很有可能是在无的放矢   必须要搞清楚的问题: 故障的表现是什么?无响应?报 ...