#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define ll long long
int algosia[100];
int bajtek[100];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int wyn_algo = 0, wyn_baj = 0;
int x;
for(int i=1; i<=18; i++){
cin>>x;
wyn_algo += x;
algosia[x] ++;
}
for(int i=1; i<=18; i++){
cin>>x;
wyn_baj += x;
bajtek[x] ++;
}
if(wyn_algo > wyn_baj){
cout<<"Algosia"<<endl;
return 0;
}
if(wyn_algo < wyn_baj){
cout<<"Bajtek"<<endl;
return 0;
}
for(int i=18; i>0; i--){
if(algosia[i] > bajtek[i]){
cout<<"Algosia"<<endl;
return 0;
}
if(algosia[i] < bajtek[i]){
cout<<"Bajtek"<<endl;
return 0;
}
}
cout<<"remis"<<endl;
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | #include<bits/stdc++.h> using namespace std; #define fi first #define se second #define ll long long int algosia[100]; int bajtek[100]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int wyn_algo = 0, wyn_baj = 0; int x; for(int i=1; i<=18; i++){ cin>>x; wyn_algo += x; algosia[x] ++; } for(int i=1; i<=18; i++){ cin>>x; wyn_baj += x; bajtek[x] ++; } if(wyn_algo > wyn_baj){ cout<<"Algosia"<<endl; return 0; } if(wyn_algo < wyn_baj){ cout<<"Bajtek"<<endl; return 0; } for(int i=18; i>0; i--){ if(algosia[i] > bajtek[i]){ cout<<"Algosia"<<endl; return 0; } if(algosia[i] < bajtek[i]){ cout<<"Bajtek"<<endl; return 0; } } cout<<"remis"<<endl; return 0; } |
English