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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <iostream>
#include <functional>
#include <numeric>
#include <vector>
using namespace std;

enum Player {
    ALGOSIA,
    BAJTEK,
    DRAW,
};

Player WhoWin(const vector<int>& algosia, const vector<int>& bajtek) {
    for (int i = 11; i >= 0; i--) {
        if (algosia[i] < bajtek[i]) {
            return BAJTEK;
        } else if (bajtek[i] < algosia[i]) {
            return ALGOSIA;
        }
    }
    return DRAW;
}

int main() {
    int score_algosia = 0, score_bajtek = 0;
    vector<int> algosia(11, 0), bajtek(11, 0);
    for (int i = 0; i < 18; i++) {
        int x;
        cin >> x;
        score_algosia += x;
        algosia[x]++;
    }
    algosia.push_back(score_algosia);
    for (int i = 0; i < 18; i++) {
        int x;
        cin >> x;
        score_bajtek += x;
        bajtek[x]++;
    }
    bajtek.push_back(score_bajtek);

    switch (WhoWin(algosia, bajtek)) {
        case BAJTEK:
            cout << "Bajtek\n";
            break;
        case ALGOSIA:
            cout << "Algosia\n";
            break;
        case DRAW:
            cout << "remis\n";
    }
    return 0;
}