#P1990. 覆盖墙壁
覆盖墙壁
Description
You have a wall of length and width . You are given two types of bricks: one is , and the other is an L-shaped brick that covers unit cells. As shown below:
0 0
0 00
Bricks can be rotated, and both types are available in unlimited quantity. Your task is to count the number of ways to tile the wall using these two types. For example, a wall can be tiled in ways, as follows:
012 002 011 001 011
012 112 022 011 001
Note that the two types can be mixed in a tiling; for example, a wall can be tiled as follows:
0112
0012
Given , compute the number of tilings for the wall. Since the result can be large, output only the last digits. For example, if the number of tilings for is , output . If the answer has fewer than digits, output it directly without leading zeros, e.g., when , output .
Input Format
A single integer , the length of the wall.
Output Format
Output the last digits of the number of tilings; if it has fewer than digits, output the entire answer.
13
3465
Hint
Constraints: .
Translated by ChatGPT 5
京公网安备 11011102002149号