[IT]/백준

[백준] 1010번 다리놓기

working_hard 2019. 9. 28. 22:34
728x90

- 파이썬의 factorial library 를 쓰면 빠르게 풀 수 있다.

import math,sys
sys.stdin = open('1.txt')


k = int(input())
for i in range(k):
    r,n = map(int, input().split())
    print(math.factorial(n)//(math.factorial(n-r)*math.factorial(r)))