此题的 LaTeX 炸了
  • 板块CF1761D Carry Bit
  • 楼主KraHere
  • 当前回复5
  • 已保存回复5
  • 发布时间2023/11/15 19:09
  • 上次更新2023/11/15 20:37:28
查看原帖
此题的 LaTeX 炸了
1126476
KraHere楼主2023/11/15 19:09

rt,说明/提示中的 LaTeX\LaTeX 整个炸掉了,因此我修复了一下:

Here are some examples for understanding carries:

 1  1  1  + 11  0  0  1  0  1  1   1  0  1  +  0  01 1  0  1  1  0   1  0  1  + 10111 1  1  0  0  0  \begin{aligned} &\begin{array}{r} ~1~~ 1~~ 1~~ \\ +~_{1}1~~ 0~~ 0~~ \\ \hline 1~~ 0~~ 1~~ 1~~ \end{array} &\begin{array}{r} ~1~~ 0~~ 1~~ \\ +~_{~}0~~ 0_{1~} 1~~ \\ \hline 0~~ 1~~ 1~~ 0~~ \end{array} & &\begin{array}{r} ~1~~ 0~~ 1~~ \\ +~_{1}0_{1} 1_{1~} 1~~ \\ \hline 1~~ 0~~ 0~~ 0~~ \end{array} \end{aligned}

So f(7,4)=1f(7,4)=1,f(5,1)=1f(5,1)=1 and f(5,3)=3f(5,3)=3.

In the first test case, all the pairs meeting the constraints are

(1,1),(1,5),(2,2),(2,3),(3,2),(4,4),(4,5),(4,6),(4,7),(5,1),(5,4),(5,6),(6,4),(6,5),(7,4)(1,1),(1,5),(2,2),(2,3),(3,2),(4,4),(4,5),(4,6),(4,7),(5,1),(5,4),(5,6),(6,4),(6,5),(7,4).

原码:

Here are some examples for understanding *carries*:

$$
\begin{aligned} 
&\begin{array}{r} 
~1~~ 1~~ 1~~ \\
+~_{1}1~~ 0~~ 0~~ \\
\hline
1~~ 0~~ 1~~ 1~~ 
\end{array}
&\begin{array}{r}
~1~~ 0~~ 1~~ \\
+~_{~}0~~ 0_{1~} 1~~ \\
\hline
0~~ 1~~ 1~~ 0~~ 
\end{array} 
& &\begin{array}{r}
~1~~ 0~~ 1~~ \\
+~_{1}0_{1} 1_{1~} 1~~ \\
\hline
1~~ 0~~ 0~~ 0~~ 
\end{array} 
\end{aligned}
$$

So $f(7,4)=1$,$f(5,1)=1$ and $f(5,3)=3$.

In the first test case, all the pairs meeting the constraints are

$(1,1),(1,5),(2,2),(2,3),(3,2),(4,4),(4,5),(4,6),(4,7),(5,1),(5,4),(5,6),(6,4),(6,5),(7,4)$.
2023/11/15 19:09
加载中...