-
[백준 문제풀이] 얼렁뚱땅 1010번 다리놓기 문제 풀이얼렁뚱땅 백준 문제풀이 2022. 3. 28. 14:15
https://www.acmicpc.net/problem/1010 https://www.acmicpc.net/problem/1010 import sys case = int(sys.stdin.readline()) #: nCm def factorial(k) : fact = 1 for i in range(1,k+1) : fact *= i return fact def combination(n,r) : return factorial(n)/(factorial(n-r) * factorial(r)) for i in range(case) : n,m = map(int,sys.stdin.readline().split()) d = [0] * (m+1) for j in range(n,m+1) : d[j] = d[j-1] + combination(j-1,n-1) print(int(d[m]))
음 .. 음 ..
마치 고등학교 확률과 통계를 푼다고 생각하면 금방 풀 거 같다
근데, combination이 뭐였는지도 까먹어버린거 같다 ㅎ
큰일이다 호호
'얼렁뚱땅 백준 문제풀이' 카테고리의 다른 글
[백준 문제풀이] 얼렁뚱땅 1300번 K번째 수 풀이 (0) 2022.03.29 [백준 문제풀이] 얼렁뚱땅 1744번 수 묶기 풀이 (0) 2022.03.29 [백준 문제풀이] 얼렁뚱땅 11727번 2xn 타일링2 풀이 (0) 2022.03.28 [백준 문제풀이] 얼렁뚱땅 9237번 이장님 초대 (0) 2022.03.25 [백준 문제풀이] 얼렁뚱땅 11650번 좌표 정렬하기 풀이 (0) 2022.03.25