#include <iostream>
#include <map>
using namespace std;
int main()
{
map<int, int> a;
map<int, int> b;
int s_a=0;
int s_b=0;
for(int i=0; i<18; i++){
int x;
cin >> x;
a[x]++;
s_a += x;
}
for(int i=0; i<18; i++){
int x;
cin >> x;
b[x]++;
s_b += x;
}
bool a_w = false;
bool b_w = false;
if(s_a == s_b){
for(int i=10; i>=1; i--){
if(a[i]>b[i]){
a_w=true;
break;
}else if(b[i]>a[i]){
b_w=true;
break;
}
}
}else if(s_a > s_b){
a_w=true;
}else{
b_w=true;
}
if(a_w){
cout << "Algosia";
}else if(b_w){
cout << "Bajtek";
}else{
cout << "remis";
}
}
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 | #include <iostream> #include <map> using namespace std; int main() { map<int, int> a; map<int, int> b; int s_a=0; int s_b=0; for(int i=0; i<18; i++){ int x; cin >> x; a[x]++; s_a += x; } for(int i=0; i<18; i++){ int x; cin >> x; b[x]++; s_b += x; } bool a_w = false; bool b_w = false; if(s_a == s_b){ for(int i=10; i>=1; i--){ if(a[i]>b[i]){ a_w=true; break; }else if(b[i]>a[i]){ b_w=true; break; } } }else if(s_a > s_b){ a_w=true; }else{ b_w=true; } if(a_w){ cout << "Algosia"; }else if(b_w){ cout << "Bajtek"; }else{ cout << "remis"; } } |
English