#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string.h>
#include <set>
#include <random>
#include <queue>
#include <map>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("arch=icelake-server")
constexpr int N = (int)2e5+11;
// constexpr int A = (int)1e9+11;
mt19937 rnd(time(nullptr));
void solve(){
int n = 18;
int cnt[2][12];
memset(cnt,0,sizeof cnt);
for(int j = 0; j < 2; j++){
for(int i = 0; i < n; i++){
int a;
cin >> a;
cnt[j][11] += a;
cnt[j][a]++;
}
}
for(int i = 11; i > 0; i--){
if(cnt[0][i] > cnt[1][i]){
cout << "Algosia\n";
return;
}
if(cnt[0][i] < cnt[1][i]){
cout << "Bajtek\n";
return;
}
}
cout << "remis\n";
return;
}
int main(){
ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
int tests = 1;
// cin >> tests;
for(int test = 1; test <= tests; test++){
solve();
}
return 0;
}
/**
* 1 2 1 2 4
* 1 1 2 2 4
**/
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 | #include <iostream> #include <algorithm> #include <numeric> #include <vector> #include <string.h> #include <set> #include <random> #include <queue> #include <map> // #include <ext/pb_ds/tree_policy.hpp> // #include <ext/pb_ds/assoc_container.hpp> using namespace std; // using namespace __gnu_pbds; // #pragma GCC optimize("Ofast") // #pragma GCC optimize("unroll-loops") // #pragma GCC target("arch=icelake-server") constexpr int N = (int)2e5+11; // constexpr int A = (int)1e9+11; mt19937 rnd(time(nullptr)); void solve(){ int n = 18; int cnt[2][12]; memset(cnt,0,sizeof cnt); for(int j = 0; j < 2; j++){ for(int i = 0; i < n; i++){ int a; cin >> a; cnt[j][11] += a; cnt[j][a]++; } } for(int i = 11; i > 0; i--){ if(cnt[0][i] > cnt[1][i]){ cout << "Algosia\n"; return; } if(cnt[0][i] < cnt[1][i]){ cout << "Bajtek\n"; return; } } cout << "remis\n"; return; } int main(){ ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr); int tests = 1; // cin >> tests; for(int test = 1; test <= tests; test++){ solve(); } return 0; } /** * 1 2 1 2 4 * 1 1 2 2 4 **/ |
English