from collections import Counter, defaultdict def get_winner(a, b): a_sum = sum(a) b_sum = sum(b) if a_sum > b_sum: return 1 if a_sum < b_sum: return -1 a_cnt = Counter(a) b_cnt = Counter(b) for i in range(10, 0, -1): if a_cnt[i] > b_cnt[i]: return 1 if a_cnt[i] < b_cnt[i]: return -1 return 0 def main(): a = input() b = input() a = [int(x) for x in a.split()] b = [int(x) for x in b.split()] winner = get_winner(a, b) if winner == 1: print("Algosia") elif winner == -1: print("Bajtek") else: print("remis") if __name__ == "__main__": main()
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 | from collections import Counter, defaultdict def get_winner(a, b): a_sum = sum(a) b_sum = sum(b) if a_sum > b_sum: return 1 if a_sum < b_sum: return -1 a_cnt = Counter(a) b_cnt = Counter(b) for i in range(10, 0, -1): if a_cnt[i] > b_cnt[i]: return 1 if a_cnt[i] < b_cnt[i]: return -1 return 0 def main(): a = input() b = input() a = [int(x) for x in a.split()] b = [int(x) for x in b.split()] winner = get_winner(a, b) if winner == 1: print("Algosia") elif winner == -1: print("Bajtek") else: print("remis") if __name__ == "__main__": main() |