ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

๋ฐ˜์‘ํ˜•
import sys
from collections import deque

input = sys.stdin.readline

T = int(input().rstrip())
for i in range(T):
    k = int(input().rstrip())
    n = int(input().rstrip())
    people = [i for i in range(1, n+1)] # 0์ธต
    # 1์ธต 3ํ˜ธ 6๋ช… 2์ธต์˜ 3ํ˜ธ 10๋ช…

    for j in range(k):
        apt = []
        for l in range(n):
            apt.append(sum(people[:l+1]))
        people = apt.copy()
        print(people)

    print(people[-1])
๋ฐ˜์‘ํ˜•

'Programming > ๋ฐฑ์ค€' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[Python] ๋ฐฑ์ค€ 10811 : ๋ฐ”๊ตฌ๋‹ˆ ๋’ค์ง‘๊ธฐ, ํŒŒ์ด์ฌ  (0) 2024.01.09
๋ž˜ํผ๋Ÿฐ์Šค  (0) 2023.09.02
230228 [1327: ์†ŒํŠธ๊ฒŒ์ž„]  (0) 2023.09.02
230219 [10026: DFS]  (0) 2023.09.02
230219 [2606: DFS]  (0) 2023.09.02
๊ณต์ง€์‚ฌํ•ญ
์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
์ตœ๊ทผ์— ๋‹ฌ๋ฆฐ ๋Œ“๊ธ€
Total
Today
Yesterday
๋งํฌ
ยซ   2025/09   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
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 29 30
๊ธ€ ๋ณด๊ด€ํ•จ
๋ฐ˜์‘ํ˜•