#include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define sn second typedef long long ll; typedef vector<int> VI; typedef vector<char> VC; typedef pair<int, int> PI; // 101, 103, 104 const int N = 18; void get_results(VI &counter, int &sum) { for (int t = 0; t < N; t++) { int x; cin >> x; sum += x; counter[x] += 1; } } int main() { VI A(11, 0); VI B(11, 0); int res_a = 0; int res_b = 0; get_results(A, res_a); get_results(B, res_b); int winner = 0; if (res_a == res_b) { for (int i = 10; i >= 0; i--) { if (A[i] > B[i]) { winner = 1; break; } else if (A[i] < B[i]) { winner = 2; break; } } } else if (res_a > res_b) { winner = 1; } else { winner = 2; } if (winner == 0) { cout << "remis"; } else if (winner == 1) { cout << "Algosia"; } else { cout << "Bajtek"; } cout << 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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | #include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define sn second typedef long long ll; typedef vector<int> VI; typedef vector<char> VC; typedef pair<int, int> PI; // 101, 103, 104 const int N = 18; void get_results(VI &counter, int &sum) { for (int t = 0; t < N; t++) { int x; cin >> x; sum += x; counter[x] += 1; } } int main() { VI A(11, 0); VI B(11, 0); int res_a = 0; int res_b = 0; get_results(A, res_a); get_results(B, res_b); int winner = 0; if (res_a == res_b) { for (int i = 10; i >= 0; i--) { if (A[i] > B[i]) { winner = 1; break; } else if (A[i] < B[i]) { winner = 2; break; } } } else if (res_a > res_b) { winner = 1; } else { winner = 2; } if (winner == 0) { cout << "remis"; } else if (winner == 1) { cout << "Algosia"; } else { cout << "Bajtek"; } cout << endl; return 0; } |