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

[백준/파이썬]14456번 Hoof, Paper, Scissors (Bronze)

by 현장 2021. 7. 30.

-코드

r1, r2 = 0, 0
for _ in range(int(input())):
    p1, p2 = map(int, input().split())
    if (p1 == 1 and p2 == 3) or (p1 == 2 and p2 == 1) or (p1 == 3 and p2 == 2):
        r1 += 1
    elif (p1 == 3 and p2 == 1) or (p1 == 1 and p2 == 2) or (p1 == 2 and p2 == 3):
        r2 += 1
print(max(r1, r2))