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

[백준/파이썬] 25814번 Heavy Numbers

by 현장 2022. 12. 7.

-Code

a, b = input().split()
a_weight = sum(list(map(int, a))) * len(a)
b_weight = sum(list(map(int, b))) * len(b)

if a_weight > b_weight:
    print(1)
elif a_weight < b_weight:
    print(2)
else:
    print(0)