No.2711 Connecting Lights
問題文最終更新日: 2024-03-27 15:52:38
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
Problem Statement
There is a grid with $N$ rows and $M$ columns, and each cell contains a light bulb that can be freely switched on or off.
Here, for the bulb in the $i$-th row from the top and the $j$-th column from the left, we write
- when the bulb is on: $A_{i,j} = 1$
- when the bulb is off: $A_{i,j} = 0$
More precisely, output the number, modulo $998244353$, of ways to set the bulbs that satisfy the following condition.
- For every $j$ satisfying $1 \leq j \leq M-1$, the following condition holds:
- There are at least $K$ values of $i$ such that $A_{i,j} = 1$ and $A_{i,j+1} = 1$.
Input
$N\ M \ K$
- $1 \leq K \leq N \leq 5$
- $1 \leq M \leq 2 \times 10^4$
- All inputs are integers.
Output
Output the number, modulo $998244353$, of ways to set the bulbs that satisfy the condition. End the output with a newline.
Sample
Sample 1
Input
2 2 1
Output
7
The following $7$ ways are all of them.
Sample 2
Input
3 4 1
Output
1129
Sample 3
Input
5 10 3
Output
252507990
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
sepa38