瞎搞题。。。凭直觉+猜测写了一发,居然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. 【单源最短路】dijstra poj 1502

    #include <cstdio> #include <iostream> #include <stdlib.h> #include <memory.h> ...

  2. WPF(x:Null 使用)

    <Window x:Class="TestOfNull.MainWindow" xmlns="http://schemas.microsoft.com/winfx/ ...

  3. php 10.2总

    注意事项 获取表单信息 <?php if($_POST["submit"]=="登录"){ echo "您输入的用户名为:".$_PO ...

  4. 在win7/8/10鼠标右键添加带管理员权限的“在此处打开命令窗口”

    Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Drive\shell\runas]@="@shell32.dll,-8506 ...

  5. Android中ViewPager如何设置不能通过屏幕左右滑动来切换页面

    //很多时候,我想禁止用户通过屏幕的左右滑动来切换界面!如何实现! //创建一个类继承viewpager,实现 onTouchEvent   和   onInterceptTouchEvent方法,都 ...

  6. building system busy, pls wait !!

    编译ca是可能会报这个错误,是189服务器上的/home/pub-work/.android_build_lock这个文件的问题,删除即可.

  7. CodeForces 681C Heap Operations(模拟)

    比较简单的模拟,建议使用STL优先队列. 代码如下: #include<iostream> #include<cstdio> #include<cstring> # ...

  8. linux下安装rabbitmq

    1.安装erlang虚拟机 Rabbitmq基于erlang语言开发,所有需要安装erlang虚拟机.安装erlang有两种方式: 第一种:使用yum安装: wget -O /etc/yum.repo ...

  9. [转]修改hosts文件不起作用

    http://wayne173.iteye.com/blog/1876565 今天遇到个很奇怪的问题,在hosts文件里添加了一些域名指向后,发现根本没起作用,后来还发现个细节,就是hosts文件左下 ...

  10. table固定宽度高度, 及overflow省略号

    整体设置标签为:td {text-overflow: ellipsis; white-space: nowrap; overflow: hidden; } table fix设置 <table ...