Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- SuNiNaTas
- CTF
- Network
- HackCTF
- 백준
- cryptography
- writeup
- Web
- 써니나타스
- MySQL
- Forensics
- N0Named
- 정렬
- 문자열
- misc
- Digital Forensics
- Python
- wargame
- 인코그니토
- Database
- Incognito
- 사칙연산
- Web Hacking
- 그리디 알고리즘
- 구현
- C
- 수학
- xcz.kr
- Text
- php
Archives
- Today
- Total
보안을 그리다, 훈이
[Baekjoon/Python3] 11050번 이항 계수 1 본문
[Baekjoon/Python3] 11050번 이항 계수 1
11050번: 이항 계수 1
첫째 줄에 \(N\)과 \(K\)가 주어진다. (1 ≤ \(N\) ≤ 10, 0 ≤ \(K\) ≤ \(N\))
www.acmicpc.net
# math 모듈 - factoral() 함수 사용시
import math
n, k = map(int, input().split())
print(int(math.factorial(n) / (math.factorial(k) * (math.factorial(n - k)))))
# factorial() 함수 구현
def factorial(a):
res = 1
for i in range(1, a + 1):
res *= i
return res
n, k = map(int, input().split())
print(int(factorial(n) / (factorial(k) * (factorial(n - k)))))
'Programming > Python & Data Structures' 카테고리의 다른 글
[Baekjoon/Python3] 11104번 Fridge of Your Dreams (0) | 2020.12.07 |
---|---|
[Baekjoon/Python3] 11098번 첼시를 도와줘! (0) | 2020.12.07 |
[Baekjoon/Python3] 11047번 동전 0 (0) | 2020.12.07 |
[Baekjoon/Python3] 11024번 더하기 4 (0) | 2020.12.07 |
[Baekjoon/Python3] 11023번 더하기 3 (0) | 2020.12.07 |
Comments