#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int ile[11][2];
int suma[2];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int i;
int n = 18;
for (int j = 0; j < 2; j++){
for (i = 0; i < n; i++){
int x;
cin>>x;
suma[j] += x;
ile[x][j]++;
}
}
if (suma[0] > suma[1]){
cout<<"Algosia\n";
return 0;
}
if (suma[1] > suma[0]){
cout<<"Bajtek\n";
return 0;
}
for (i = 10; i ; i--){
if (ile[i][0] > ile[i][1]){
cout<<"Algosia\n";
return 0;
}
if (ile[i][1] > ile[i][0]){
cout<<"Bajtek\n";
return 0;
}
}
cout<<"remis\n";
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 | #include <bits/stdc++.h> using namespace std; typedef long long ll; int ile[11][2]; int suma[2]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int i; int n = 18; for (int j = 0; j < 2; j++){ for (i = 0; i < n; i++){ int x; cin>>x; suma[j] += x; ile[x][j]++; } } if (suma[0] > suma[1]){ cout<<"Algosia\n"; return 0; } if (suma[1] > suma[0]){ cout<<"Bajtek\n"; return 0; } for (i = 10; i ; i--){ if (ile[i][0] > ile[i][1]){ cout<<"Algosia\n"; return 0; } if (ile[i][1] > ile[i][0]){ cout<<"Bajtek\n"; return 0; } } cout<<"remis\n"; return 0; } |
English