본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 31694번 Kto wygrał?

by 현장 2024. 4. 28.

-Code

algosia = list(map(int, input().split()))
bajtek = list(map(int, input().split()))

if sum(algosia) != sum(bajtek):
    print("Algosia" if sum(algosia) > sum(bajtek) else "Bajtek")
    exit()

tie = False

for i in range(10, 0, -1):
    if algosia.count(i) > bajtek.count(i):
        print("Algosia")
        tie = True
        break
    elif algosia.count(i) < bajtek.count(i):
        print("Bajtek")
        tie = True
        break

if not tie:
    print("remis")