반응형
https://www.acmicpc.net/problem/13251
import sys
import math
M = int(sys.stdin.readline())
stone = list(map(int,sys.stdin.readline().split()))
K = int(sys.stdin.readline())
N = sum(stone)
total = math.comb(N, K)
same_color = 0
for s in stone:
same_color += math.comb(s, K)
print(same_color/total)
반응형