hiho week 80 register

Ended

Participants:173

Verdict:Accepted
Score:100 / 100
Submitted:2016-01-14 23:29:50

Lang:G++

Edit
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
#include <iostream>
#include <string.h>
#include <cmath>
#include <algorithm>
using namespace std;
int cr, cy, cb, a[3], b[3];
char str[20005];
int main()
{
    int x, y, z, i, j;
    while(~scanf("%d%d%d",&b[0], &b[1], &b[2]))
    {
        sort(b,b+3);
        scanf("%s",str);
        int len=strlen(str);
        int max=0;
        int l=0, r=0;
        cr=0;
        cy=0;
        cb=0;
        for(i=0; i<len; i++)
        {
            if(str[i]=='R')
                cr++;
            else if(str[i]=='B')
                cb++;
            else
                cy++;
            a[0]=abs(cr-cb);
            a[1]=abs(cr-cy);
            a[2]=abs(cy-cb);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX