====== 패션왕 신해빈 ====== ===== 풀이 ===== * [[ps:problems:programmers:42578]] 과 동일한 문제. 설명은 그쪽을 참조. * 문제의 원 출처는 Benelux Algorithm Programming Contest 2013이다 ===== 코드 ===== """Solution code for "BOJ 9375. 패션왕 신해빈". - Problem link: https://www.acmicpc.net/problem/9375 - Solution link: http://www.teferi.net/ps/problems/boj/9375 """ import collections import functools import operator def main(): t = int(input()) for _ in range(t): n = int(input()) clothes = [input().split() for _ in range(n)] counter = collections.Counter(category for name, category in clothes) print(functools.reduce(operator.mul, (v + 1 for v in counter.values()), 1) - 1) if __name__ == '__main__': main() {{tag>BOJ ps:problems:boj:실버_3}}