2 2
29
There are $14$ matrices that can be obtained by repeating the operations:
$\begin{pmatrix}0&0 \\ 0&0\end{pmatrix} \begin{pmatrix}1&0 \\ 0&0\end{pmatrix} \begin{pmatrix}0&1 \\ 0&0\end{pmatrix} \begin{pmatrix}1&1 \\ 0&0\end{pmatrix} \begin{pmatrix}0&0 \\ 1&0\end{pmatrix} \begin{pmatrix}1&0 \\ 1&0\end{pmatrix} \begin{pmatrix}0&1 \\ 1&0\end{pmatrix} \begin{pmatrix}1&1 \\ 1&0\end{pmatrix} \begin{pmatrix}0&1 \\ 0&1\end{pmatrix} \begin{pmatrix}1&1 \\ 0&1\end{pmatrix} \begin{pmatrix}0&0 \\ 1&1\end{pmatrix} \begin{pmatrix}1&0 \\ 1&1\end{pmatrix} \begin{pmatrix}0&1 \\ 1&1\end{pmatrix} \begin{pmatrix}1&1 \\ 1&1\end{pmatrix}$
The answer is $0+1+1+2+1+2+2+3+2+3+2+3+3+4=29$.
$\begin{pmatrix}0&0 \\ 0&1\end{pmatrix}$ and $\begin{pmatrix}1&0 \\ 0&1\end{pmatrix} $ cannot be obtained by any sequence of operations.1 10
5120
123 456
428623282
{
"problem": {
"name": "Limestone",
"description": {
"content": "You are given positive integers $H,W$. There is an $H \\times W$ matrix $A=(A_{i,j})\\ (1\\leq i\\leq H,1\\leq j\\leq W)$, where initially all elements are $0$. You can perform the following two types of op",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc199_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given positive integers $H,W$.\nThere is an $H \\times W$ matrix $A=(A_{i,j})\\ (1\\leq i\\leq H,1\\leq j\\leq W)$, where initially all elements are $0$.\nYou can perform the following two types of op...",
"is_translate": false,
"language": "English"
}
]
}