POJ 1905 Expanding Rods

Xilinx Vitis HLS教程1--Vitis HLS概述[01/12] Xilinx Vitis HLS教程[01/10]前言1. Vitis HLS简介1.1 软件工程师的设计原则1.1.1 简介1.1.2 吞吐量和性能1.2.3 架构问题1.2.4 FPGA编程的3大范式1.2.4.1 生产者-消费者范式1.2.4.2 流式数据范式1.2.4.3 流水线范式1.2.5 3种范式结合 前言 项目中使用到Xilinx Zynq UltraScale+ MPSoC ZCU102 开发板,领导指示研究"xilinx软件自带的c语言综合器"。对于一个硬件一窍不通的我来说,甚至不知道 阅读详情

Expanding Rods
Time Limit: 1000MS Memory Limit: 30000K
Total Submissions: 12160 Accepted: 3160

Description

When a thin rod of length L is heated n degrees, it expands to a new length
L'=(1+n*C)*L, where C is the coefficient of heat expansion. 
When a thin rod is mounted on two solid walls and then heated, it expands and takes the shape of a circular segment, the original rod being the chord of the segment. 

Your task is to compute the distance by which the center of the rod is displaced. 

Input

The input contains multiple lines. Each line of input contains three non-negative numbers: the initial lenth of the rod in millimeters, the temperature change in degrees and the coefficient of heat expansion of the material. Input data guarantee that no rod expands by more than one half of its original length. The last line of input contains three negative numbers and it should not be processed.

Output

For each line of input, output one line with the displacement of the center of the rod in millimeters with 3 digits of precision. 

Sample Input

1000 100 0.0001
15000 10 0.00006
10 0 0.001
-1 -1 -1

Sample Output

61.329
225.020
0.000
, where C is the coefficient of heat expansion. 
When a thin rod is mounted on two solid walls and then heated, it expands and takes the shape of a circular segment, the original rod being the chord of the segment. 

Your task is to compute the distance by which the center of the rod is displaced. 

Input

The input contains multiple lines. Each line of input contains three non-negative numbers: the initial lenth of the rod in millimeters, the temperature change in degrees and the coefficient of heat expansion of the material. Input data guarantee that no rod expands by more than one half of its original length. The last line of input contains three negative numbers and it should not be processed.

Output

For each line of input, output one line with the displacement of the center of the rod in millimeters with 3 digits of precision. 

Sample Input

1000 100 0.0001
15000 10 0.00006
10 0 0.001
-1 -1 -1

Sample Output

61.329
225.020
0.000

题目大意:有已知长度的一根木棒,随着温度变化有伸缩变化,根据公式L'=(1+n*C)*L得到新的木棍长度,在两面墙之间会弯曲,求木棍前后状态的中点之间的距离。


解题思路:联系相关几何知识得到公式:L'=2*r*arcsin(L/(2*r),r=(4*h*h+L*L)/(8*h)。采用二分枚举h的值得到r的值,然后公式1作为判断条件,直接求出h的值。


解题过程:wa点:注意浮点型的二分结束循环的条件是(high-low>minx),这题minx精度尽量大一些才能过。


代码如下:


#include <cstdio>
#include <cmath>
const double minx=1e-8;
int main()
{
    double l,n,c,L,high,low,mid,r;
    while(scanf("%lf%lf%lf",&l,&n,&c)!=EOF&&(l>=0||n>=0||c>=0))
    {
        L=(1+n*c)*l;
        high=l/2;
        low=0.0;
        while(high-low>minx)
        {
			mid=(high+low)/2;
            r=(4*mid*mid+l*l)/(8*mid);
            if(2*r*asin(l/(2*r))<L)
                low=mid;
            else
                high=mid;
        }
        printf("%.3f\n",mid);
    }
    return 0;
}




silvaco例子库学习—mos1ex02 mos1ex02相比于第一个例子,主要进行了mos的输出特性仿真,工艺结构是一样的,所以就只简单讨论一下atlas特性仿真的部分。 阅读详情

相关推荐

SigmaStar(星宸科技)SSC33X系列

目前,SSC33X系列已经量产了接近两年,SDK成熟稳定,功耗表现良好,图像效果出色,广泛应用在AI枪机、AI球机、AI云台机、多目摄像机、停车场闸机、人脸门禁、人脸锁、门铃猫眼等产品上。

Comake Online的博客 1万+

POJ 1905 Expanding Rods(几何+二分)

POJ 1905 Expanding Rods(几何+二分) http://poj.org/problem?id=1905 题意:        一根两端固定在两面墙上的杆 受热弯曲后变弯曲 求前后两个状态的杆的中点位置的距离. 弯曲后的杆可以看成一个圆的弧,而弯曲前的杆可以看成是该弧的弦. 分析:        假设当前的圆半径为r,且该弧S对应的圆心角为2 θ. h是我们要求的

code 763

php对接建行h5网页支付

php对接建行h5网页支付前言H5页面支付H5页面支付回调通知退款及其他的业务 前言 最近接到公司乙方要求,需要再支付上面增加建行的支付渠道。之前一直用的都是微信和支付宝这种第三方支付平台,银行直接对接比较少。没办法就只能上网搜索,搜索一番返现网上对接建行的资料比较少,没办法只好摸着石头过河,中间也借鉴了一些大佬的文章内容。 H5页面支付 根据建行的h5网页支付对接文档,还是可以看出是比较简单的。...

lihua100862的博客 5408

POJ 1905 Expanding Rods(二分)

Expanding Rods Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 20224 Accepted: 5412 Description When a thin rod of length L is heated n degrees, it expands to a new length L’=(1+n*C)*L, ...

日拱一卒,功不唐捐 2749

从Cartographer3D到LIO-SAM:主流3D激光SLAM算法怎么选?一份给机器人工程师的实战避坑指南

本文深入探讨了从Cartographer3D到LIO-SAM等主流3D激光SLAM算法的选型策略,为机器人工程师提供实战避坑指南。通过对比不同算法在传感器配置、环境特性和计算资源等方面的表现,帮助开发者根据项目需求选择最优方案,并分享传感器标定、资源优化等实用技巧。

weixin_27310985的博客 154

告别手动标注!PDMS NakiToolkit插件安装与初体验:以Pipeline工具为例

本文详细介绍了PDMS NakiToolkit插件的安装与使用,特别是其Pipeline工具如何通过自动化标注和材料统计功能大幅提升三维工厂设计效率。从环境准备到实战演示,帮助工程师告别繁琐的手动标注工作,实现项目交付周期的大幅缩短。

weixin_30047059的博客 349

POJ 1905, Expanding Rods

Time Limit: 1000MSMemory Limit: 30000KTotal Submissions: 4863Accepted: 1058 DescriptionWhen a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coe...

weixin_33816611的博客 266

Tessent ATPG进阶:解锁多种Fault Model的工程实践与选型指南

本文深入探讨Tessent ATPG中多种Fault Model的工程实践与选型策略,涵盖Stuck-at、Transition、Bridge等核心模型的应用场景与配置技巧。通过实际案例解析,展示如何组合不同Fault Model提升芯片测试覆盖率,特别针对汽车电子、超低功耗芯片等复杂场景提供专业解决方案。

weixin_30219613的博客 198

POJ 1905 Expanding Rods

Expanding Rods Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 9197   Accepted: 2293 Description When a thin rod of length L is heated n degrees, it expands to

ACM2272902662的专栏 621

Docker:快速部署 Temporal 工作流引擎的技术指南

Temporal是一个开源的分布式工作流引擎,适用于复杂业务流程(如订单处理、支付流程等),提供状态持久化、自动重试、多语言SDK支持等特性。部署简单,支持Docker Compose,包含核心服务、Web UI及数据库。以TypeScript为例,开发者可快速编写工作流(如订单处理)和Worker,通过CLI或SDK启动和管理。Temporal简化了分布式系统的可靠性设计,适合电商、自动化任务等场景。

木头 640

如何跑通SuperPoint+LightGlue的训练代码使用gluefactory进行训练和评估?

🏆本文收录于专栏,主要记录项目实战过程中所遇到的Bug或因后果及提供真实有效的解决方案,希望能够助你一臂之力,帮你早日登顶实现财富自由🚀;同时,欢迎大家!持续更新中,up!up!up!!

**My Coding Family** 1785

Expanding Rods POJ - 1905

E - Expanding Rods POJ - 1905 When a thin rod of length L is heated n degrees, it expands to a new length L’=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounted on two ...

小飞猪的博客 245

MDIO接口协议与其详解——单片机

在单片机领域,通过MDIO接口可以与外部设备进行通信,实现对设备的控制和数据的读写。通过本文的介绍,你可以了解到MDIO接口协议的原理和使用方法,并参考源代码示例进行实际的开发和应用。具体的初始化方法与单片机的型号和开发环境有关,可以参考相应的单片机手册和开发工具的文档。(1)发送读取命令:向MDIO线发送读取命令,通常是发送一个特定的控制字节,用于指示要读取的寄存器地址。(1)发送写入命令:向MDIO线发送写入命令,通常是发送一个特定的控制字节,用于指示要写入的寄存器地址。二、MDIO接口协议使用方法。

web_class282的博客 2623

poj 1905 Expanding Rods

题目链接:点击打开链接 Description When a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion.  When a thin rod is mounted on tw

Vision 443

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

POJ1905-Expanding Rods

全解题报告索引目录 -> 【北大ACM – POJ试题分类】 转载请注明出处:http://exp-blog.com ------------------------------------------------------------------------- 大致题意: 一根两端固定在两面墙上的杆 受热弯曲后变弯曲 求前后两个状态的杆的中点位置的距离 解题...

ζёСяêτ - 小優YoU 5500

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

poj 1905 Expanding Rods

Expanding Rods Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 15096   Accepted: 4009 Description When a thin rod of length L is heated n degrees, it expan

樱花满地集于我心,楪舞纷飞祈愿相随 271

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

POJ 1905 Expanding Rods 木棍膨胀

描述 当长度为L的一根细木棍的温度升高n度,它会膨胀到新的长度L'=(1+n*C)*L,其中C是热膨胀系数。 当一根细木棍被嵌在两堵墙之间被加热,它将膨胀形成弓形的弧,而这个弓形的弦恰好是未加热前木棍的原始位置。 你的任务是计算木棍中心的偏移距离。 输入 三个非负实数:木棍初始长度(单位:毫米),温度变化(单位:度),以及材料的热膨胀系数。 保证木棍不会膨胀

在思索中前行! 4082

POJ 1905 Expanding Rods

Expanding Rods Time Limit:500MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Description When a thin rod of length L is heated n degrees, it expands to a

※夏日星空※ 255

poj 1905 Expanding Rods

Description When a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounted ...

bandiaodai5734的博客 160

【二分】POJ1905[Expanding Rods]题解

POJ1905题解。

ZigZagK的博客 663

POJ 1905 Expanding Rods

题目大意: 一根某种材料做的直杆被夹在两面墙之间,当他受热时长度会变长,就会因两面墙的挤压而向上隆起。长度变化函数为 L'=(1+n*C)*L,给定L,C,n,求向上拱起的高度H。 解题思路: 这是两个最关键的计算式,可以手动计算出来。 然后对h进行二分查找。 注意: 1、误差分析,我的是到了10^-5才可以了。 2、注意输出。最好用cout。 下面是代码:

脑残的孩子只有慢慢学。。 5443

poj1905Expanding Rods

题目来源:http://poj.org/problem?id=1905 二分答案。 一开始做的时候二分的是半径,但考虑到如果长度没有增加那么半径应是无穷大的,这样精度上会有误差,提交几次都是WA。 事实上,本题可以枚举角度,即膨胀后的弧的弧度值,可以证明弧度值是小于π/4的(因为题目中说膨胀后的长度不会超过原长的1.5倍)。 在(0,π/4)的区间上,弧长随角度的增大而减小,故可使用二

No cost too great! 303

【poj1905】Expanding Rods——二分

题目: Expanding Rods Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 14196   Accepted: 3697 Description When a thin rod of length L is heated n degrees, i

CFhM_R's Blog 402

POJ1905 Expanding Rods

Problem Description When a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounted on two solid

u013776243的专栏 566

POJ 1905.Expanding Rods

题目:http://poj.org/problem?id=1905 AC代码(C++): #include #include #include #include #include #include #include #include #include #include #define INF 0x7fffffff #define eps 1e-4 #defin

njyexiong的博客 233

【POJ 1905】 Expanding Rods (二分)

【POJ 1905】 Expanding Rods 公式+二分 题意是一根棍 恰好夹在两面墙之间 在n温度下膨胀成(1+n*c)*l长度 问此时中的距原中点距离 膨胀后变成一段弧 也就是圆的一部分 原来的棍子就变成了圆的截线。。。这不是高中很常见的图么。。。 不会在电脑作图。。大家手画一下就知道了 这样做几条辅助线 从圆心做截线的垂线延长到弧 设棍子原长L 膨胀后(弧)长s 膨胀后中点与

ACMer' 1338
上一篇: POJ 3273 Monthly Expense
下一篇: POJ 3258 River Hopscotch
雨狮子
博客等级 码龄12年 24粉丝 185原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值