#include <cstdio>
#include <bits/stdc++.h>
using namespace std;
array<int, 18> a, b;
int Read(auto& arr)
{
for (int& i : arr)
scanf("%d", &i);
ranges::sort(arr);
ranges::reverse(arr);
return accumulate(arr.begin(), arr.end(), 0);
}
int Algosia()
{
printf("Algosia\n");
return 0;
}
int Bajtek()
{
printf("Bajtek\n");
return 0;
}
int main()
{
int sa = Read(a);
int sb = Read(b);
if (sa > sb)
return Algosia();
else if (sa < sb)
return Bajtek();
for (int i = 0; i < 18; i++)
if (a[i] > b[i])
return Algosia();
else if (a[i] < b[i])
return Bajtek();
printf("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 35 36 37 38 39 40 41 42 43 44 | #include <cstdio> #include <bits/stdc++.h> using namespace std; array<int, 18> a, b; int Read(auto& arr) { for (int& i : arr) scanf("%d", &i); ranges::sort(arr); ranges::reverse(arr); return accumulate(arr.begin(), arr.end(), 0); } int Algosia() { printf("Algosia\n"); return 0; } int Bajtek() { printf("Bajtek\n"); return 0; } int main() { int sa = Read(a); int sb = Read(b); if (sa > sb) return Algosia(); else if (sa < sb) return Bajtek(); for (int i = 0; i < 18; i++) if (a[i] > b[i]) return Algosia(); else if (a[i] < b[i]) return Bajtek(); printf("remis\n"); return 0; } |
English