[백준 1010][Python] 다리놓기

봉글렛·2023년 1월 2일

백준

목록 보기
19/55

문제 링크 https://www.acmicpc.net/problem/1010

풀이

testcase = int(input())
result = list()
for i in range(testcase):
    a, b = map(int, input().split())
    x, y, z = 1, 1, 1
    for j in range(1, a+1):
        x *= j
    for j in range(1, b+1):
        y *= j
    for j in range(1, b-a+1):
        z *= j
    result.append(y//(x*z))

for i in result:
    print(i)
profile
어쩌다 개발자 (할 수 있을 때까지!!!!)

0개의 댓글