#include <bits/stdc++.h> using namespace std; int suma1=0,suma2=0; int t1[12],t2[12]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int x; for(int i=1;i<=18;i++){ cin>>x; t1[x]++; suma1+=x; } for(int i=1;i<=18;i++){ cin>>x; t2[x]++; suma2+=x; } if(suma1>suma2) cout<<"Algosia\n"; else if(suma2>suma1) cout<<"Bajtek\n"; else{ for(int i=10;i>=0;i--){ if(t1[i]>t2[i]){ cout<<"Algosia\n"; return 0; } if(t2[i]>t1[i]){ 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 | #include <bits/stdc++.h> using namespace std; int suma1=0,suma2=0; int t1[12],t2[12]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int x; for(int i=1;i<=18;i++){ cin>>x; t1[x]++; suma1+=x; } for(int i=1;i<=18;i++){ cin>>x; t2[x]++; suma2+=x; } if(suma1>suma2) cout<<"Algosia\n"; else if(suma2>suma1) cout<<"Bajtek\n"; else{ for(int i=10;i>=0;i--){ if(t1[i]>t2[i]){ cout<<"Algosia\n"; return 0; } if(t2[i]>t1[i]){ cout<<"Bajtek\n"; return 0; } } cout<<"remis\n"; } return 0; } |