瞎搞题。。。凭直觉+猜测写了一发,居然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. cocos2d-x中使用tinyxml遇到的问题及解决

    1.问题: cocos2d-x集成tinyxml后在vs下运行正常,但是在Android下在读取xml文件时发生异常,读取时使用的是LoadFile函数 2. 解决方案: 先把xml文件内容读取到内存 ...

  2. iOS NSString类中获取子字符串

    NSString类中提供了这样三个方法用于获取子字符串: – substringFromIndex://取字符串长度从0开始,当index=str.length时字符串为空"" – ...

  3. HDU/5499/模拟

    题目链接 模拟题,直接看代码. £:分数的计算方法,要用double; #include <set> #include <map> #include <cmath> ...

  4. css 8.1

    1. border-collapse 属性设置是否将表格边框折叠为单一边框: table { border-collapse:collapse;  } 如果没有规定 !DOCTYPE,border-c ...

  5. android 图片拍照图片旋转的处理方式

    第一种:String str=path; /** * 读取图片属性:旋转的角度 * * @param path * 图片绝对路径 * @return degree旋转的角度 */ private vo ...

  6. 转:Selenium Grid+JAVA +Windows 配置(Selenium 2.0)

    Selenium-Grid 允许你在多台机器的多个浏览器上并行的进行测试,也就是说,你可以同时运行多个测试.本质上来说就是,Selenium-Grid 支持分布式的测试执行.它可以让你的测试在一个分布 ...

  7. linux服务器安装php GD扩展库方法

    Strict Standards: Only variables should be assigned by reference in/home/wienholl/public_html/includ ...

  8. O(n)线性时间找第K大,中位数

    运用快速排序的思想,可以达到线性时间找到一串数的第K大 #include<cstdio> #define F(i,a,b) for(int i=a;i<=b;i++) ],n; vo ...

  9. angular实现select的ng-options4

    ng实现简单的select <div ng-controller="ngSelect"> <select ng-model="vm.selectVal& ...

  10. 如何在Apache中配置多端口访问

    环境: Windows server 2008 R2, Apache, PHP5 步骤: 建立一个目录,里面放置一个index.php. 打开Apache\conf\httpd.conf 文件,做如下 ...