#include <bits/stdc++.h> #define def_times(a, b) int a = 0; a<b; a++ #define lol long long using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int ass[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, bss[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; for(def_times(i, 18)) { int tmp; cin >> tmp; ass[11] += tmp; ass[tmp]++; } for(def_times(i, 18)) { int tmp; cin >> tmp; bss[11] += tmp; bss[tmp]++; } for(int i = 11; i >=0; i--) { if(ass[i] == bss[i]) continue; if(ass[i] > bss[i]) cout << "Algosia" << endl; else cout << "Bajtek" << endl; break; } }
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 | #include <bits/stdc++.h> #define def_times(a, b) int a = 0; a<b; a++ #define lol long long using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int ass[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, bss[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; for(def_times(i, 18)) { int tmp; cin >> tmp; ass[11] += tmp; ass[tmp]++; } for(def_times(i, 18)) { int tmp; cin >> tmp; bss[11] += tmp; bss[tmp]++; } for(int i = 11; i >=0; i--) { if(ass[i] == bss[i]) continue; if(ass[i] > bss[i]) cout << "Algosia" << endl; else cout << "Bajtek" << endl; break; } } |