#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <unordered_map>
#include <assert.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds
using namespace std;
template<class A, class B>
ostream& operator<<(ostream& o, const pair<A, B>& p) {
return o << '(' << p.first << ", " << p.second << ')';
}
template<class A, class B, class C>
ostream& operator<<(ostream& o, const tuple<A, B, C>& t) {
return o << '(' << get<0>(t) << ", " << get<1>(t) << ", " << get<2>(t) << ')';
}
template<class T>
auto operator<<(ostream& o, const T& x) -> decltype(x.end(), o) {
o << '{';
int i = 0;
for (const auto& e : x) {
o << (", ") + 2 * !i++ << e;
}
return o << '}';
}
auto operator<<(ostream& o, const string& s) -> decltype(o) {
for (const auto& e : s) {
o << e;
}
return o;
}
//#define DEBUG
#ifdef DEBUG
#define fastio()
#define debug(x...) cerr << "[" #x "]: ", [](auto... $) {((cerr << $ << "; "), ...); }(x), cerr << '\n'
#define asrt(x) if (!(x)) { cerr << "Assertion failed: " << #x << " in line " << __LINE__ << endl; exit(1); }
#else
#define fastio() ios_base::sync_with_stdio(0); cin.tie(0);
#define debug(...)
#define asrt(x)
#endif
#define pii pair<int,int>
#define inf 2'000'000'000
#define llinf 8'000'000'000'000'000'000
#define mod 998'244'353
#define mod7 1'000'000'007
#define mod9 1'000'000'009
#define eps 0.00000000001
#define all(x) x.begin(),x.end()
#define rev(x) x.rbegin(),x.rend()
#define decrease(x) x,vector<x>,greater<x>
#define maxn
typedef long long ll;
typedef long double ld;
int alg[20], baj[20];
void solve() {
int n = 18;
for (int i = 1; i <= n; i++) {
cin >> i[alg];
i[alg] = -alg[i];
0[alg] += i[alg];
}
for (int i = 1; i <= n; i++) {
cin >> i[baj];
i[baj] = -baj[i];
0[baj] += i[baj];
}
sort(alg + 1, alg + n + 1);
sort(baj + 1, baj + n + 1);
for (int i = 0; i <= n; i++) {
debug(i, i[alg], i[baj]);
if (i[alg] < i[baj]) {
cout << "Algosia\n";
exit(0);
}
if (i[alg] > i[baj]) {
cout << "Bajtek\n";
exit(0);
}
}
cout << "remis\n";
}
signed main() {
fastio();
if (maxn + 0 == 0) cerr << "WARNING - maxn is undefined\n";
if (maxn + 0 <= 100) cerr << "warning - maxn might be too low\n";
int t = 1;
//cin >> t;
while (t--) solve();
}
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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | #include <iostream> #include <algorithm> #include <vector> #include <queue> #include <unordered_map> #include <assert.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/trie_policy.hpp> //using namespace __gnu_pbds using namespace std; template<class A, class B> ostream& operator<<(ostream& o, const pair<A, B>& p) { return o << '(' << p.first << ", " << p.second << ')'; } template<class A, class B, class C> ostream& operator<<(ostream& o, const tuple<A, B, C>& t) { return o << '(' << get<0>(t) << ", " << get<1>(t) << ", " << get<2>(t) << ')'; } template<class T> auto operator<<(ostream& o, const T& x) -> decltype(x.end(), o) { o << '{'; int i = 0; for (const auto& e : x) { o << (", ") + 2 * !i++ << e; } return o << '}'; } auto operator<<(ostream& o, const string& s) -> decltype(o) { for (const auto& e : s) { o << e; } return o; } //#define DEBUG #ifdef DEBUG #define fastio() #define debug(x...) cerr << "[" #x "]: ", [](auto... $) {((cerr << $ << "; "), ...); }(x), cerr << '\n' #define asrt(x) if (!(x)) { cerr << "Assertion failed: " << #x << " in line " << __LINE__ << endl; exit(1); } #else #define fastio() ios_base::sync_with_stdio(0); cin.tie(0); #define debug(...) #define asrt(x) #endif #define pii pair<int,int> #define inf 2'000'000'000 #define llinf 8'000'000'000'000'000'000 #define mod 998'244'353 #define mod7 1'000'000'007 #define mod9 1'000'000'009 #define eps 0.00000000001 #define all(x) x.begin(),x.end() #define rev(x) x.rbegin(),x.rend() #define decrease(x) x,vector<x>,greater<x> #define maxn typedef long long ll; typedef long double ld; int alg[20], baj[20]; void solve() { int n = 18; for (int i = 1; i <= n; i++) { cin >> i[alg]; i[alg] = -alg[i]; 0[alg] += i[alg]; } for (int i = 1; i <= n; i++) { cin >> i[baj]; i[baj] = -baj[i]; 0[baj] += i[baj]; } sort(alg + 1, alg + n + 1); sort(baj + 1, baj + n + 1); for (int i = 0; i <= n; i++) { debug(i, i[alg], i[baj]); if (i[alg] < i[baj]) { cout << "Algosia\n"; exit(0); } if (i[alg] > i[baj]) { cout << "Bajtek\n"; exit(0); } } cout << "remis\n"; } signed main() { fastio(); if (maxn + 0 == 0) cerr << "WARNING - maxn is undefined\n"; if (maxn + 0 <= 100) cerr << "warning - maxn might be too low\n"; int t = 1; //cin >> t; while (t--) solve(); } |
English