BOJ - 9872 - Record Keeping
Updated:
import sys
def solution():
N = int(sys.stdin.readline())
groups = [''] * 1001
for i in range(N):
arr = list(map(str, sys.stdin.readline().split()))
arr.sort(reverse=True)
groups[i] = arr[0] + ' ' + arr[1] + ' ' + arr[2]
ret = 0
for i in range(N):
cnt = 0
for j in range(N):
if groups[i] == groups[j]: cnt += 1
if ret < cnt:
ret = cnt
print(ret)
solution()
https://www.acmicpc.net/problem/9872
Leave a comment