728x90 110502 [Python] 백준 11050 이항 계수 1 - 조합론 4 백준 11050 이항 계수 1 문제 자연수 N과 정수 K가 주어졌을 때 이항 계수 를 구하는 프로그램을 작성하시오. 입력 첫째 줄에 N과 K가 주어진다. (1 ≤ N ≤ 10, 0 ≤ K ≤ N) 출력 를 출력한다. 제출 def ftrl(n): if n==0: return 1 return n*ftrl(n-1) n,k=map(int,input().split()) print(ftrl(n)//(ftrl(k)*ftrl(n-k))) 예제 5 2 결과 11050번: 이항 계수 1 첫째 줄에 \(N\)과 \(K\)가 주어진다. (1 ≤ \(N\) ≤ 10, 0 ≤ \(K\) ≤ \(N\)) www.acmicpc.net 2023. 4. 24. [Java] 백준 11050 이항 계수 1 - 조합 알아보기(1) 백준 11050 이항 계수 1 문제 입력 출력 제출 import java.util.*; public class Main { static int N, K; static int[][] D; public static void main(String[] args) throws Exception{ Scanner sc = new Scanner(System.in); N = sc.nextInt(); K = sc.nextInt(); D = new int[N + 1][N + 1]; for (int i = 0; i 2022. 12. 28. 이전 1 다음 728x90