[Baekjoon] 9461 파도반 수열 python

sorzzzzy·2021년 8월 4일
0

Baekjoon Algorithm

목록 보기
4/46
post-thumbnail

🏷 문제


💡 코드

test_case = int(input())

for i in range(test_case):
    res_list = [1,1,1,2,2]
    n = int(input())
    
    if n >= 6:
        for j in range(5, n):
            res_list.append(res_list[j-1]+res_list[j-5])    
    print(res_list[n-1])
    

🔑

profile
Backend Developer

0개의 댓글