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[+];
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的更多相关文章
- Codeforces 626B Cards(模拟+规律)
B. Cards time limit per test:2 seconds memory limit per test:256 megabytes input:standard input outp ...
- Codeforces 999F Cards and Joy(二维DP)
题目链接:http://codeforces.com/problemset/problem/999/F 题目大意:有n个人,n*k张卡牌,每个人会发到k张卡牌,每个人都有一种喜欢的卡牌f[i],当一个 ...
- Codeforces 830B - Cards Sorting 树状数组
B. Cards Sorting time limit per test 1 second memory limit per test 256 megabytes input standard inp ...
- codeforces #364a Cards
cf的a题没什么好说到,100的量级,每个人给2张牌,使每个人手中的牌点数相等.保证有一种分配方案. 对每个人,先计算出手中的牌的点数,然后循环两遍拿牌就可以. A. Cards time lim ...
- Codeforces 701A. Cards(水)
A. Cards time limit per test 1 second memory limit per test 256 megabytes input standard input outpu ...
- 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 ...
- Codeforces 1278F: Cards
题目传送门:CF1278F. 题意简述: 有 \(n\) 个独立随机变量 \(x_i\),每个随机变量都有 \(p = 1/m\) 的概率取 \(1\),有 \((1-p)\) 的概率取 \(0\). ...
- CodeForces 830B - Cards Sorting
将每个数字的位置存进该数字的vector中 原数组排个序从小到大处理,每次在vector里二分找到距离当前位置“最远”的位置(相差最大),更新答案 树状数组维护每个数字现在的位置和原位置之差 #inc ...
- 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 ...
随机推荐
- Openlayers 3 图层探查功能
<body> <div id="map"></div> <script> var map=new ol.Map({ target:& ...
- Tiny210编译和烧写u-boot步骤
当有多个交叉编译器是,不方便设置环境变量时,可以在编译命令中指定交叉编译器,具体如下: make ARCH=arm CROSS_COMPILE=/opt/FriendlyARM/toolschain/ ...
- Android自动化测试之环境搭建
Android自动化测试之环境搭建 一.Android-sdk介绍 SDK(Software development kit)软件开发工具包.被软件开发工程师用于为特定的软件包.软件框架.硬件平台. ...
- HDU 2209 翻纸牌游戏
翻纸牌游戏 Time Limit : 9000/3000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total Submiss ...
- play1.x vs play2.x 对比(转)
个人看到对比play1.x和play2.x比较的文章中,写的最深入,最清晰的一个.转自:http://freewind.me/blog/20120728/965.html 为了方便群中的Play初学者 ...
- MyEclipse8.5安装findbugs方法
step 1:首先从官网下载findbugs插件: edu.umd.cs.findbugs.plugin.eclipse_1.3.9.20090821.zipstep 2:将解压之后的edu.umd. ...
- JAVA项目复习的一些小细节
使用javadoc完成自动文档,这一段将在后期进行介绍. 类,方法和变量的作用域. 使用修饰符public和修饰符private,对于类和方法来说并没有什么不妥的,但是变量使用public却在某些时刻 ...
- As Fast As Possible
As Fast As Possible On vacations n pupils decided to go on excursion and gather all together. They n ...
- Swaps in Permutation
Swaps in Permutation You are given a permutation of the numbers 1, 2, ..., n and m pairs of position ...
- CentOS查询 杀死进程
ps aux | grep XXX 查询进程 ps a 显示现行终端机下的所有程序,包括其他用户的程序. ps -A 显示所有程序. ps c 列出程序时,显示每个程序真正的指令名称,而不包含路径,参 ...