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

建议使用的浏览器:

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

6062:RXD and logic gates

Special Judge 特殊评判
题目描述
ioXDR is a master in logic circuits. One day he comes up with a special logic gate.
It requires 3 input bits $a, b, c$. It would then make $c = c ~xor~ (a ~and~b)$ and remain $a$ and $b$ unchanged, where $and$ means bitwise and and $xor$ means bitwise exclusive or.
ioXDR has a boolean function $f(x_1,x_2, \dots, x_m)$, where $x_i \in \{0, 1\}$ and $f(x_1,x_2, \dots x_m) \in \{0, 1\}$.
He wants to design a circuit and could simulate the boolean function.
He has $m$ input bits, and $1$ output bit, and some extra bits. The number of extra bits and the initial value of extra bits could be determined freely. The initial value of output bit could also be set freely.
**This problem is judged by SPJ, so any valid answer could be accepted**
$m\leq 8$
输入解释
There are several test cases, please keep reading until EOF.
For each test case, the first line consists of an integer $m$, corresponding to the number of input bits.
For the next $2^m$ lines, there is a string with the length of $m$, which only consists of 01, and an integer $\in \{0, 1\}$, which describes the boolean function.
There are 50 test cases.
输出解释
**It is very crucial, please read this part carefully**
For each test case, the first line you need to output an $0,1$ integer, which means the initial value of the output bit.
The next line you need to output an integer $t$, which means the number of the extra bits.
The next $t$ lines, in each line you have to output an 01 integer to describe the initial value of extra bits.
**The input bits are labeled as 1 ~ m, the output bit is labeled as m + 1, the extra bits are labeled as m + 2 ~ m + t + 1**
The next line you need to ouput an integer $n$, which means the number of logic gates.
The next $n$ lines, in each line you have to give us $3$ **different** integers $1\leq a, b, c\leq m + t + 1$, which means one logic gate.
**The simulator would simulate from top to bottom**
You have to guarantee that $n, t\leq 800$
输入样例
1
0 1
1 0
输出样例
1
1
1
1
1 3 2
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6062

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

共提交 0

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