#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <array>
int main() {
std::array<int, 11> a{}, b{};
int sa=0, sb=0;
for(int c=0;c<18;++c){int d;std::cin>>d;++a[d];sa+=d;}
for(int c=0;c<18;++c){int d;std::cin>>d;++b[d];sb+=d;}
if(sa!=sb){
if(sa<sb) std::cout<<"Bajtek";
else std::cout<<"Algosia";
return 0;
}
for(int c = 10; c > 0; --c) {
if(a[c]==b[c]) continue;
if(a[c]<b[c]) std::cout<<"Bajtek";
else std::cout<<"Algosia";
return 0;
}
std::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 | #include <iostream> #include <vector> #include <algorithm> #include <numeric> #include <array> int main() { std::array<int, 11> a{}, b{}; int sa=0, sb=0; for(int c=0;c<18;++c){int d;std::cin>>d;++a[d];sa+=d;} for(int c=0;c<18;++c){int d;std::cin>>d;++b[d];sb+=d;} if(sa!=sb){ if(sa<sb) std::cout<<"Bajtek"; else std::cout<<"Algosia"; return 0; } for(int c = 10; c > 0; --c) { if(a[c]==b[c]) continue; if(a[c]<b[c]) std::cout<<"Bajtek"; else std::cout<<"Algosia"; return 0; } std::cout<<"remis"; } |
English