hiho week 80 register

Ended

Participants:173

Verdict:Accepted
Score:100 / 100
Submitted:2016-01-12 13:05:54

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 <list>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int main() {
    // input x y z
    vector<int> xyz(3);
    for (int i = 0; i < 3; i++) {
        cin >> xyz[i];
    }
    sort(xyz.begin(), xyz.end());
    // input sequence
    string seq;
    cin >> seq;
    // ******* solve ********
    // imitation
    int r = 0, b = 0, y = 0;// denote the number of existent balls
    vector<int> rby(3, 0);  // denote the differences
    int maxret = 0;         // record the max number of the balls
    // loop to deal with
    for (unsigned i = 0; i < seq.length(); i++) {
        if (seq[i] == 'R') r++;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX