日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

1137

發布時間:2024/6/21 综合教程 24 生活家
生活随笔 收集整理的這篇文章主要介紹了 1137 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1137 - Expanding Rods

PDF (English) Statistics Forum
Time Limit:0.5 second(s) Memory Limit:32 MB

When a thin rod of lengthLis heatedndegrees, it expands to a new lengthL' = (1+n*C)*L, whereCis 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. That means you have to calculatehas in the picture.

Input

Input starts with an integerT (≤ 20), denoting the number of test cases.

Each case contains three non-negative real numbers: the initial length of the rod in millimetersL, the temperature change in degreesnand the coefficient of heat expansion of the materialC. Input data guarantee that no rod expands by more than one half of its original length. All the numbers will be between 0 and 1000 and there can be at most 5 digits after the decimal point.

Output

For each case, print the case number and the displacement of the center of the rod in single line. Errors less than10-6will be ignored.

Sample Input

Output for Sample Input

3

1000 100 0.0001

150 10 0.00006

10 0 0.001

Case 1: 61.3289915

Case 2: 2.2502024857

Case 3: 0


SPECIAL THANKS: JANE ALAM JAN (DESCRIPTION, SOLUTION, DATASET, PICTURES)

思路:L' = p*r ——p為弧度

r = (L/2)/sin(p/2)

然后公式可以化為 (2×L') /L=(p)/sin(p/2);

然后右邊求導可知道右邊隨p單調增,然后二分p即可。

 1 #include<stdio.h>
 2 #include<algorithm>
 3 #include<iostream>
 4 #include<string.h>
 5 #include<queue>
 6 #include<stack>
 7 #include<set>
 8 #include<math.h>
 9 using namespace std;
10 typedef long long LL;
11 double pi=acos(-1);
12 int main(void)
13 {
14     int i,j,k;
15     scanf("%d",&k);
16     int s;
17     double L ,n,c;
18     for(s=1; s<=k; s++)
19     {
20         scanf("%lf %lf %lf",&L,&n,&c);
21         double l=0;
22         double r=2*pi;
23         int ans=0;
24         double ll=(1+n*c)*L;
25         while(ans<=100)
26         {
27             double mid=(l+r)/2;
28             double ac=2*ll*sin(1.0*mid/2);
29             double ak=L*mid;
30             if(ac>=ak)
31             {
32                 l=mid;
33             }
34             else r=mid;
35             ans++;
36         }
37         double rr=(1.0*L/2)/(sin(1.0*r/2));
38         double hh=rr*cos(1.0*r/2);
39         double h=rr-hh;
40         printf("Case %d:",s);
41         printf(" %.6f
",h);
42     }
43     return 0;
44 }

油!油!you@

總結

以上是生活随笔為你收集整理的1137的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。