#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for(int i = (a); i <= (b); ++i) #define REP(i, n) for(int i = 0; i < (n); ++i) template<class T> int size(T && a) { return (int)(a.size()); } ostream& operator << (ostream &os, string str) { for(char c : str) os << c; return os; } template <class A, class B> ostream& operator << (ostream &os, const pair<A, B> &p) { return os << '(' << p.first << "," << p.second << ')'; } template <class T> auto operator << (ostream &os, T &&x) -> decltype(x.begin(), os) { os << '{'; for(auto it = x.begin(); it != x.end(); ++it) os << *it << (it == prev(x.end()) ? "" : " "); return os << '}'; } template <class T> ostream& operator << (ostream &os, vector<vector<T>> vec) { for(auto x : vec) os << "\n " << x; return os; } void dump() {} template <class T, class... Args> void dump(T &&x, Args... args) { cerr << x << "; "; dump(args...); } #ifdef DEBUG # define debug(x...) cerr << "[" #x "]: ", dump(x), cerr << '\n' #else # define debug(...) 0 #endif //-------------------------------------------------- int main() { ios_base::sync_with_stdio(0); cin.tie(0); const int n = 18; const int max_score = 10; vector<int> a(max_score + 1), b(max_score + 1); int a_sum = 0, b_sum = 0; REP (i, n) { int x; cin >> x; a_sum += x; ++a[x]; } REP (i, n) { int x; cin >> x; b_sum += x; ++b[x]; } reverse(a.begin(), a.end()); reverse(b.begin(), b.end()); if (a_sum != b_sum) { cout << (a_sum > b_sum ? "Algosia\n" : "Bajtek\n"); } else if (a != b) { cout << (a > b ? "Algosia\n" : "Bajtek\n"); } else { cout << "remis\n"; } }
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 65 66 67 68 69 70 71 72 73 | #include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for(int i = (a); i <= (b); ++i) #define REP(i, n) for(int i = 0; i < (n); ++i) template<class T> int size(T && a) { return (int)(a.size()); } ostream& operator << (ostream &os, string str) { for(char c : str) os << c; return os; } template <class A, class B> ostream& operator << (ostream &os, const pair<A, B> &p) { return os << '(' << p.first << "," << p.second << ')'; } template <class T> auto operator << (ostream &os, T &&x) -> decltype(x.begin(), os) { os << '{'; for(auto it = x.begin(); it != x.end(); ++it) os << *it << (it == prev(x.end()) ? "" : " "); return os << '}'; } template <class T> ostream& operator << (ostream &os, vector<vector<T>> vec) { for(auto x : vec) os << "\n " << x; return os; } void dump() {} template <class T, class... Args> void dump(T &&x, Args... args) { cerr << x << "; "; dump(args...); } #ifdef DEBUG # define debug(x...) cerr << "[" #x "]: ", dump(x), cerr << '\n' #else # define debug(...) 0 #endif //-------------------------------------------------- int main() { ios_base::sync_with_stdio(0); cin.tie(0); const int n = 18; const int max_score = 10; vector<int> a(max_score + 1), b(max_score + 1); int a_sum = 0, b_sum = 0; REP (i, n) { int x; cin >> x; a_sum += x; ++a[x]; } REP (i, n) { int x; cin >> x; b_sum += x; ++b[x]; } reverse(a.begin(), a.end()); reverse(b.begin(), b.end()); if (a_sum != b_sum) { cout << (a_sum > b_sum ? "Algosia\n" : "Bajtek\n"); } else if (a != b) { cout << (a > b ? "Algosia\n" : "Bajtek\n"); } else { cout << "remis\n"; } } |