practivceAlgorithm/백준

[백준][Python] 14696 딱지놀이

findTheValue 2021. 8. 29. 00:34

카드 숫자 센다음 큰 숫자부터 갯수 비교

 

import sys
input = sys.stdin.readline

N = int(input())
for _ in range(N):
    a_cnt = [0]*5
    b_cnt = [0]*5
    a_n, *a_card = map(int, input().split())
    b_n, *b_card = map(int, input().split())
    for card in a_card:
        a_cnt[card] += 1
    for card in b_card:
        b_cnt[card] += 1
    for i in range(1,5):
        if a_cnt[-i] > b_cnt[-i]:
            print('A')
            break
        elif a_cnt[-i] < b_cnt[-i]:
            print('B')
            break
    else:
        print('D')

'practivceAlgorithm > 백준' 카테고리의 다른 글

[백준][Python] 2564 경비원  (0) 2021.08.29
[백준][Python] 2605 줄세우기  (0) 2021.08.29
[백준][Python] 13300 방배정  (0) 2021.08.29
[백준][Python] 10163 색종이  (0) 2021.08.29
[백준][Python] 10158 개미  (0) 2021.08.28