#include <iostream>
#define _USE_MATH_DEFIN
#include <cmath>
#include <math.h>
#include <algorithm>
#include <ctime>
#include <cstdlib>
//Michał Kowalczyk
using namespace std;
int Algosia[19];
int Bajtek[19];
string s(int Al[], int Ba[]) {
long long bajl = 0, algl = 0;
for (int i = 0; i < 18; i++)
{
bajl = 0;
algl = 0;
for (int i = 10; i >= 0; i--)
{
if (Ba[i] == i)
{
bajl++;
}
if (Al[i] == i)
{
algl++;
}
}
if (bajl > algl)
{
return "Bajtek";
}
else if (algl > bajl)
{
return "Algosia";
}
}
return "remis";
}
int main()
{
ios::sync_with_stdio(false);
long long bajl = 0, algl = 0;
for (int i = 0; i < 18; i++)
{
cin >> Algosia[i];
algl += Algosia[i];
}
for (int i = 0; i < 18; i++)
{
cin >> Bajtek[i];
bajl = Bajtek[i];
}
if (bajl == algl)
{
cout << s(Algosia, Bajtek);
}
else if (bajl < algl)
{
cout << "Algosia";
}
else
{
cout << "Bajtek";
}
}
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 57 58 59 60 61 62 63 64 65 66 67 | #include <iostream> #define _USE_MATH_DEFIN #include <cmath> #include <math.h> #include <algorithm> #include <ctime> #include <cstdlib> //Michał Kowalczyk using namespace std; int Algosia[19]; int Bajtek[19]; string s(int Al[], int Ba[]) { long long bajl = 0, algl = 0; for (int i = 0; i < 18; i++) { bajl = 0; algl = 0; for (int i = 10; i >= 0; i--) { if (Ba[i] == i) { bajl++; } if (Al[i] == i) { algl++; } } if (bajl > algl) { return "Bajtek"; } else if (algl > bajl) { return "Algosia"; } } return "remis"; } int main() { ios::sync_with_stdio(false); long long bajl = 0, algl = 0; for (int i = 0; i < 18; i++) { cin >> Algosia[i]; algl += Algosia[i]; } for (int i = 0; i < 18; i++) { cin >> Bajtek[i]; bajl = Bajtek[i]; } if (bajl == algl) { cout << s(Algosia, Bajtek); } else if (bajl < algl) { cout << "Algosia"; } else { cout << "Bajtek"; } } |
English