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

建议使用的浏览器:

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

3082:Simplify The Circuit

题目描述
You may be puzzled by the complicated circuits ever. Now let us simplify them.
The task is: give you a parallel circuit(并联电路); you should calculate the resistance value (电阻)of it.
You may suppose the parallel circuit is made up of several simple series circuits(简单的串联电路).
输入解释
The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.
Each test case starts with a line contains only one integer n (0 < n <= 20), indicating the number of simple series circuits. Next n lines are the descriptions of each simple series circuit. The wire is consisted by the character “-”. And resistances are show by positive integers, means their resistance values. The line’s length is shorter than 100 characters, and the count of resistance in each simple series circuit is no more than 20.
I assure all the calculations by integers using in this problem will not overflow the integer.
输出解释
For each case, please output the resistance value of the parallel circuit.
输入样例
2
1
---5----
2
----2----3-1----
---2---2-------2-
输出样例
5.00
3.00
来自杭电HDUOJ的附加信息
Author possessor WC
Recommend lcy

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

源链接: HDU-3082

最后修改于 2020-10-25T22:59:50+00:00 由爬虫自动更新

共提交 0

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