A7937 | Bowls
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
注意这题要加上这个:
```
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
```
```
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
```
输入格式
Once Petya was in such a good mood that he decided to help his mum with the washing-up. There were $n$ dirty bowls in the sink. From the geometrical point of view each bowl looks like a blunted cone. We can disregard the width of the walls and bottom. Petya puts the clean bowls one on another naturally, i. e. so that their vertical axes coincide (see the picture). You will be given the order in which Petya washes the bowls. Determine the height of the construction, i.e. the distance from the bottom of the lowest bowl to the top of the highest one.


输出格式
The first input line contains integer $n$ ( $1<=n<=3000$ ). Each of the following $n$ lines contains 3 integers $h$ , $r$ and $R$ ( $1<=h<=10000,1<=r<R<=10000$ ). They are the height of a bowl, the radius of its bottom and the radius of its top. The plates are given in the order Petya puts them on the table.
输入输出样例
输入 #1
2 40 10 50 60 20 30
输出 #1
70.00000000
输入 #2
3 50 30 80 35 25 70 40 10 90
输出 #2
55.00000000
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted