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

[백준/파이썬] 25933번 Medal Ranking

by 현장 2023. 11. 26.

-Code

for _ in range(int(input())):
    total_set = list(map(int, input().split()))
    usa = total_set[:3]
    rua = total_set[3:]
    count = sum(usa) > sum(rua)
    color = False

    for i in range(3):
        if usa[i] > rua[i]:
            color = True
            break
        elif usa[i] < rua[i]:
            break
        else:
            continue

    if color and count:
        res = "both"
    elif color and not count:
        res = "color"
    elif not color and count:
        res = "count"
    else:
        res = "none"

    print(*total_set)
    print(res)
    print()