#include <bits/stdc++.h> using namespace std; const int MAX = 18; int main() { vector<int> alg(MAX), baj(MAX); vector<int> pktA(11, 0), pktB(11, 0); int sumA = 0, sumB = 0; for (int i = 0; i < MAX; ++i) { cin >> alg[i]; sumA += alg[i]; pktA[alg[i]]++; } for (int i = 0; i < MAX; ++i) { cin >> baj[i]; sumB += baj[i]; pktB[baj[i]]++; } if (sumA != sumB) { cout << (sumA > sumB ? "Algosia" : "Bajtek") << endl; } else { for (int i = 10; i >= 0; --i) { if (pktA[i] != pktB[i]) { cout << (pktA[i] > pktB[i] ? "Algosia" : "Bajtek") << endl; return 0; } } cout << "remis" << endl; } 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 35 36 | #include <bits/stdc++.h> using namespace std; const int MAX = 18; int main() { vector<int> alg(MAX), baj(MAX); vector<int> pktA(11, 0), pktB(11, 0); int sumA = 0, sumB = 0; for (int i = 0; i < MAX; ++i) { cin >> alg[i]; sumA += alg[i]; pktA[alg[i]]++; } for (int i = 0; i < MAX; ++i) { cin >> baj[i]; sumB += baj[i]; pktB[baj[i]]++; } if (sumA != sumB) { cout << (sumA > sumB ? "Algosia" : "Bajtek") << endl; } else { for (int i = 10; i >= 0; --i) { if (pktA[i] != pktB[i]) { cout << (pktA[i] > pktB[i] ? "Algosia" : "Bajtek") << endl; return 0; } } cout << "remis" << endl; } return 0; } |