#ifdef _MSC_VER
#ifndef __GNUC__
#pragma warning(disable: 4996)
#endif
#define main main0
#endif
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
int wynikA = 0, wynikB = 0;
vector<int> wynikiA(11, 0);
vector<int> wynikiB(11, 0);
for(int i = 0, wynik; i < 18; ++i) {
cin >> wynik;
wynikA += wynik;
++wynikiA[wynik];
}
for(int i = 0, wynik; i < 18; ++i) {
cin >> wynik;
wynikB += wynik;
++wynikiB[wynik];
}
if(wynikA > wynikB) {
cout << "Algosia" << endl;
return 0;
}
if(wynikA < wynikB) {
cout << "Bajtek" << endl;
return 0;
}
vector<int>::reverse_iterator ritA = wynikiA.rbegin();
vector<int>::reverse_iterator ritB = wynikiB.rbegin();
do {
if(*ritA > *ritB) {
cout << "Algosia" << endl;
return 0;
}
if(*ritA < *ritB) {
cout << "Bajtek" << endl;
return 0;
}
++ritA, ++ritB;
} while(ritA != wynikiA.rend());
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 | #ifdef _MSC_VER #ifndef __GNUC__ #pragma warning(disable: 4996) #endif #define main main0 #endif #include <iostream> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef unsigned int uint; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); int wynikA = 0, wynikB = 0; vector<int> wynikiA(11, 0); vector<int> wynikiB(11, 0); for(int i = 0, wynik; i < 18; ++i) { cin >> wynik; wynikA += wynik; ++wynikiA[wynik]; } for(int i = 0, wynik; i < 18; ++i) { cin >> wynik; wynikB += wynik; ++wynikiB[wynik]; } if(wynikA > wynikB) { cout << "Algosia" << endl; return 0; } if(wynikA < wynikB) { cout << "Bajtek" << endl; return 0; } vector<int>::reverse_iterator ritA = wynikiA.rbegin(); vector<int>::reverse_iterator ritB = wynikiB.rbegin(); do { if(*ritA > *ritB) { cout << "Algosia" << endl; return 0; } if(*ritA < *ritB) { cout << "Bajtek" << endl; return 0; } ++ritA, ++ritB; } while(ritA != wynikiA.rend()); cout << "remis" << endl; return 0; } |
English