#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define mid ((l+r)/2)
#define siz(x) (int)(x).size()
#define BOOST ios_base::sync_with_stdio(0), cin.tie(0)
#define deb(x) cout << #x << ": " << x << "\n"
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
int a[11];
void solve(){
int sum = 0;
for(int i=0; i<18; i++){
int x; cin >> x;
a[x]++;
sum += x;
}
for(int i=0; i<18; i++){
int x; cin >> x;
a[x]--;
sum -= x;
}
if(sum){
if(sum > 0) cout << "Algosia\n";
else cout << "Bajtek\n";
return;
}
for(int i=10; i>0; i--){
if(a[i]){
if(a[i] > 0) cout << "Algosia\n";
else cout << "Bajtek\n";
return;
}
}
cout << "remis\n";
}
int main(){
BOOST;
int q;
q = 1;
while(q--)
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 | #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define mid ((l+r)/2) #define siz(x) (int)(x).size() #define BOOST ios_base::sync_with_stdio(0), cin.tie(0) #define deb(x) cout << #x << ": " << x << "\n" typedef long long ll; typedef long double ld; typedef pair<int, int> ii; int a[11]; void solve(){ int sum = 0; for(int i=0; i<18; i++){ int x; cin >> x; a[x]++; sum += x; } for(int i=0; i<18; i++){ int x; cin >> x; a[x]--; sum -= x; } if(sum){ if(sum > 0) cout << "Algosia\n"; else cout << "Bajtek\n"; return; } for(int i=10; i>0; i--){ if(a[i]){ if(a[i] > 0) cout << "Algosia\n"; else cout << "Bajtek\n"; return; } } cout << "remis\n"; } int main(){ BOOST; int q; q = 1; while(q--) solve(); } |
English