BOJ - 4493 - 가위 바위 보?

Updated:

import sys

def solution():
    T = int(input())
    for _ in range(T):
        ret = 0
        N = int(input())
        for _ in range(N):
            a, b = map(str, sys.stdin.readline().split())
            if a == b: pass
            elif a == 'R' and b == 'P':
                ret += 1
            elif a == 'P' and b == 'S':
                ret += 1
            elif a == 'S' and b == 'R':
                ret += 1
            else:
                ret -= 1
        if ret > 0:
            print('Player 2')
        elif ret == 0:
            print('TIE')
        else:
            print('Player 1')

solution()

https://www.acmicpc.net/problem/4493

Categories:

Updated:

Leave a comment