#include <bits/stdc++.h>
using namespace std;
int a[18];
int b[18];
int main()
{
ios_base::sync_with_stdio(0);
int suma=0, sumb=0;
cin.tie(0);
for(int i=0; i<18; i++)
{
cin >>a[i];
suma+=a[i];
}
for(int i=0; i<18; i++)
{
cin >>b[i];
sumb+=b[i];
}
if(suma>sumb) cout <<"Algosia";
else if(sumb>suma) cout <<"Bajtek";
else
{
sort(a, a+18);
sort(b, b+18);
int it=17;
while(it>=0 && a[it]==b[it]) it--;
if(it==-1) cout <<"remis";
else if(a[it]>b[it]) cout <<"Algosia";
else cout <<"Bajtek";
}
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 | #include <bits/stdc++.h> using namespace std; int a[18]; int b[18]; int main() { ios_base::sync_with_stdio(0); int suma=0, sumb=0; cin.tie(0); for(int i=0; i<18; i++) { cin >>a[i]; suma+=a[i]; } for(int i=0; i<18; i++) { cin >>b[i]; sumb+=b[i]; } if(suma>sumb) cout <<"Algosia"; else if(sumb>suma) cout <<"Bajtek"; else { sort(a, a+18); sort(b, b+18); int it=17; while(it>=0 && a[it]==b[it]) it--; if(it==-1) cout <<"remis"; else if(a[it]>b[it]) cout <<"Algosia"; else cout <<"Bajtek"; } return 0; } |
English