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
54
55
56
57
58
#include <iostream>
#include <string>


int main()
{
    int girlResults[11] = { 0 };
    int boyResults[11] = { 0 };

    int girlSum = 0;
    int boySum = 0;

    std::string result = "remis";


    for (int i = 0; i < 18; i++) {
        int input;
        std::cin >> input;

        girlResults[input]++;
    }

    for (int i = 0; i < 18; i++) {
        int input;
        std::cin >> input;

        boyResults[input]++;
    }

    for (int i = 10; i >= 0; i--) {
        girlSum += i * girlResults[i];
        boySum += i * boyResults[i];

        if (result == "remis") {
            if (girlResults[i] == boyResults[i]) {
                result = "remis";
            }
            else if (girlResults[i] > boyResults[i]) {
                result = "Algosia";
            }
            else {
                result = "Bajtek";
            }
        }
    }

    if (girlSum > boySum) {
        std::cout << "Algosia";
    }
    else if (girlSum < boySum) {
        std::cout << "Bajtek";
    }
    else {
        std::cout << result;
    }

    return 0;
}