====== 3 x n 타일링 ====== * BOJ의 [[ps:problems:boj:2133|타일 채우기]]와 동일한 문제이다 ===== 풀이 ===== * [[ps:problems:boj:2133|타일 채우기]] 참조. ===== 코드 ===== """Solution code for "Programmers 12902. 3 x n 타일링". - Problem link: https://programmers.co.kr/learn/courses/30/lessons/12902 - Solution link: http://www.teferi.net/ps/problems/programmers/12902 """ from teflib import combinatorics MOD = 1_000_000_007 def solution(n): if n % 2: return 0 else: return combinatorics.linear_homogeneous_recurrence([4, -1], [1, 3], n // 2, MOD) * Dependency: [[:ps:teflib:combinatorics#linear_homogeneous_recurrence|teflib.combinatorics.linear_homogeneous_recurrence]] {{tag>프로그래머스 ps:problems:programmers:Level_4}}