문제
나의 풀이
case = int(input())
# 0층1호 : 1
for _ in range(case):
k = int(input())
n = int(input())
f = [x for x in range(1, n+1)]
# print(f)
for i in range(1,k+1):
for index,value in enumerate(f):
# print(index)
if index == 0:
continue
else:
f[index] += f[index-1]
# print(f)
if i == k:
break
print(f[n-1])
남의 풀이
T = int(input())
for _ in range(T):
k = int(input())
n = int(input())
people = [ i for i in range(1, n+1)]
for __ in range(k):
for j in range(1,n):
people[j] += people[j-1]
print(people[-1])
Reference
느낀점