#include <bits/stdc++.h> using namespace std; int pos[2][12] = {0}; int tmp; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); for (int i = 0; i < 2; ++i) { for (int j = 0; j < 18; ++j) { cin >> tmp; pos[i][tmp]++; pos[i][11] += tmp; } } for (int j = 11; j >= 1; --j) { if (pos[0][j] == pos[1][j]) { continue; } if (pos[0][j] > pos[1][j]) { cout << "Algosia"; } else { cout << "Bajtek"; } return 0; } cout << "remis"; return 0; }
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 | #include <bits/stdc++.h> using namespace std; int pos[2][12] = {0}; int tmp; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); for (int i = 0; i < 2; ++i) { for (int j = 0; j < 18; ++j) { cin >> tmp; pos[i][tmp]++; pos[i][11] += tmp; } } for (int j = 11; j >= 1; --j) { if (pos[0][j] == pos[1][j]) { continue; } if (pos[0][j] > pos[1][j]) { cout << "Algosia"; } else { cout << "Bajtek"; } return 0; } cout << "remis"; return 0; } |