uva 1607 gates

In contemporary VLSI chip industry, the software tools used by
electrical engineers perform many optimizations. Your task is to
implement one specific optimization of some chip design. Your tool is
given an acyclic net of NAND gates (NAND gate computes the negated
conjunction of its inputs, i.e. the output value of the gate is 0 if
and only if its both input values are 1). The net is a part of already
synthesized component and cannot be changed. All the inputs of the net
are connected to one signal x. The objective is to disconnect x from
some inputs and to assign constant signals 0 and/or 1 to those inputs
in such a way that the function implemented by the design remains
unchanged.

We say that an assignment of x’s and/or 0’s and/or 1’s to the inputs
of the net is optimal if the number of inputs connected to x is the
smallest possible but the net still computes the same function as if
all the inputs were connected to x.

Example

Look at the following design.

We can change it to the design with only one variable input, for
example:

(Observe that there are other ways of connecting the inputs to just
one x and to some number of 0’s and 1’s that implement the same
function).

Task

Write a program which for each data set:

reads the description of the net,
computes an optimal assignment of x's and/or 0's and/or 1's to the inputs of the net,
writes the result. 

Input

The first line of the input contains exactly one positive integer d
equal to the number of data sets, 1 ≤ d

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 栅闸是一种用于控制人员或车辆出入的设备。它主要由一个金属栅栏和一个可移动的门组成。栅闸通常用于维护安全和实施出入管制。 栅闸的首要作用是控制人员和车辆的进入和离开。它通常安装在公共场所、建筑物入口、停车场等地方,以限制非授权人员或车辆的进入。例如,许多高楼大厦经常会设置栅闸以确保只有持有有效许可的人员才能进入。栅闸通过阻止闯入者或者没有权限的人员进入,从而提供了安全性保障。 此外,栅闸还能够控制车辆的进入和出去。在大型停车场或加油站等地方,栅闸可以确保只有支付了费用的车辆才能进入。它可以通过自动或手动方式操作,只有在通过支付或解锁后才能打开。这种方式不仅保证了资金安全,还减少了非授权车辆的滥用或欺骗。 栅闸还能够帮助管理人员实施出入控制。通过安装类似身份验证系统的设备,栅闸可以识别并验证人员的身份和许可证。这样一来,只有授权人员才能进入,确保了管理和控制的有效性。 总之,栅闸是一种重要的设备,用于维护安全,控制出入和管理人员的进出。它通过栅栏和门的结合,能够提供有效的出入管制,保护建筑物和公共场所的安全。它的应用范围广泛,既可以用于大规模场所,也可以用于个人住宅,发挥着重要的作用。 ### 回答2: 栏杆闸门是一种常见的交通设施,用于控制车辆和行人的进出。栏杆闸门广泛应用于停车场、高速公路、收费站、车站、汽车修理厂等场所。 栏杆闸门有多种形式,包括手动控制和自动控制。手动控制的栏杆闸门一般由人工操作,其主要功能是限制车辆和行人进出的时间和数量。例如,在停车场中,当车位已满时,栏杆闸门会降下,禁止车辆进入,以便维持停车场的秩序。而在高速公路的收费站中,栏杆闸门会根据车辆缴费情况开启或关闭。这些手动栏杆闸门即简单又实用,但需要人工操作。 自动控制的栏杆闸门常用于需要频繁开关的场所。这些栏杆闸门一般由电子设备控制,可以通过遥控或感应器自动开关。例如,停车场的自动栏杆闸门会通过感应车辆进出自动打开和关闭。这种类型的栏杆闸门提高了进出的便利性,节省了人力资源,并且能够更准确地控制进出的车辆和行人。 总之,栏杆闸门是一种重要的交通设施,可以有效地控制车辆和行人的进出。无论是手动控制还是自动控制的栏杆闸门,都对维护交通秩序和提高出入口管理起到了关键的作用。随着科技的发展,栏杆闸门的功能和性能也会不断升级,以应对不断增长的交通需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值