#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> a(18),b(18);
int sA = 0, sB = 0;
for (int i = 0; i < 18; i++) {
scanf("%d", &a[i]);
sA += a[i];
}
for (int i = 0; i < 18; i++) {
scanf("%d", &b[i]);
sB += b[i];
}
sort(a.begin(), a.end(), greater<int>());
sort(b.begin(), b.end(), greater<int>());
if (sA != sB) {
if (sA > sB) puts("Algosia");
else puts("Bajtek");
return 0;
}
if (a != b) {
if (a > b) puts("Algosia");
else puts("Bajtek");
return 0;
}
puts("remis");
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 | #include <cstdio> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> a(18),b(18); int sA = 0, sB = 0; for (int i = 0; i < 18; i++) { scanf("%d", &a[i]); sA += a[i]; } for (int i = 0; i < 18; i++) { scanf("%d", &b[i]); sB += b[i]; } sort(a.begin(), a.end(), greater<int>()); sort(b.begin(), b.end(), greater<int>()); if (sA != sB) { if (sA > sB) puts("Algosia"); else puts("Bajtek"); return 0; } if (a != b) { if (a > b) puts("Algosia"); else puts("Bajtek"); return 0; } puts("remis"); return 0; } |
English