当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6067:Big Integer

题目描述
Little Q likes positive big integers in base $k$, but not all big integers. He doesn't like integers with zeroes, including leading zeroes. He is even particular with the occurrence of each digit. Formally it can be described as a matrix $g_{1..k-1,0..n}$, for every digit $i$ from $1$ to $k-1$, he doesn't like integers having exactly $j$-digit $i$ when $g_{i,j}=0$. He also can't accept any digit appearing more than $n$ times.



Picture from Wikimedia Commons


Little Q's taste changes every day. There are $m$ days in total, on $i$-th day $g_{u_i,v_i}$ flipped($0$ to $1$ and $1$ to $0$). Let $cnt(i)$ denotes the number of big integers Little Q likes after $i$-th day's change, where $cnt(0)$ denotes the answer before all changes. Your task is to calculate the following thing :
\begin{eqnarray*}
\left(\sum_{i=0}^m cnt(i)\right)\bmod 786433
\end{eqnarray*}
输入解释
The first line of the input contains an integer $T(1\leq T\leq5)$, denoting the number of test cases.

In each test case, there are $3$ integers $k,n,m(3\leq k\leq 10,1\leq n\leq 14000,1\leq m\leq 200)$ in the first line, denoting the base, the upper limit and the number of days.

For the next $k-1$ lines, each line contains $n+1$ integers $g_{i,0},g_{i,1},...,g_{i,n}(0\leq g_{i,j}\leq 1)$, denoting the matrix $g$.

For the next $m$ lines, each line contains $2$ integers $u_i,v_i(1\leq u_i\leq k-1,0\leq v_i\leq n)$, denoting a changed position in $g$.
输出解释
For each test case, print a single line containing an integer, denoting the answer.
输入样例
1
3 2 2
101
010
1 1
1 2
输出样例
13
提示
cnt(0)=4 : 112,121,211,2.
cnt(1)=6 : 112,121,211,2,12,21.
cnt(2)=3 : 2,12,21.
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6067

最后修改于 2020-10-25T23:28:01+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
12000/6000MS(Java/Others) 524288/524288K(Java/Others)