| TheForces Round #14 (Cool-Forces) |
|---|
| Finished |
You're given a grid of size $$$n \cdot m$$$, Each cell of the grid contains "0", "1", or "?". For every "?" We should randomly choose "0" or "1" and put it in there. Now your task is to find the probability that there aren't two adjacent "1" in the grid, For cell $$$(i, j)$$$, all cells $$$(i + 1, j), (i - 1, j), (i, j + 1), (i, j - 1)$$$ are counted as it's adjacent cells. Print the answer modulo $$$998244353$$$.
In the first line of input, You'll receive two integers $$$n$$$ and $$$m$$$ which $$$n$$$ shows the number of rows and $$$m$$$ shows the number of columns.
$$$1 \le n, m \le 15$$$.
In the second line you'll receive a grid of size $$$n \cdot m$$$ which only contains of "?", "0" or "1".
Print the answer modulo $$$998244353$$$.
2 5 0?100 1000?
499122177
2 2 ?1 01
0
| Name |
|---|


