2020-수학-가형-홀수-28

문제

2020-수학-가형-홀수-28

풀이

from sympy import Rational
from itertools import product
from collections import Counter
all_possibilities = list(product("123456", repeat=5))
count = 0
for event in all_possibilities:
    counter_obj = Counter(event)
    if counter_obj["1"] in [0,1] :
        if counter_obj["3"] in [0,1] :
            if counter_obj["5"] in [0,1] :
                if counter_obj["2"] in [0,2] :
                    if counter_obj["4"] in [0,2] :
                        if counter_obj["6"] in [0,2] :
                            count +=1
count
450