6746.Counting Tilings

Time Limit: 1s Memory Limit: 512MB

Your task is to count the number of ways you can fill an $n \times m$ grid using $1 \times 2$ and $2 \times 1$ tiles.

Input Format(From the terminal/stdin)

The only input line has two integers $n$ and $m$ .

  • $1 \le n \le 10$
  • $1 \le m \le 1000$

Output Format(To the terminal/stdout)

Print one integer: the number of ways modulo $10^9+7$ .

Sample Input

Copy
4 7
 · \n

Sample Output

Copy
781
   \n
Source: CSES, Dynamic Programming, 2181

Submit

请先 登录

© 2025 FAQs