Ball Dropping
生活随笔
收集整理的這篇文章主要介紹了
Ball Dropping
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
Ball Dropping
題意:
求?的具體長度
題解:
算一算就出來了
代碼:
#include<bits/stdc++.h> using namespace std; int main(){double r,a,b,h;cin>>r>>a>>b>>h;if(2*r<=b&&2*r<=a){printf("Drop");}else {double x=b*h/(a-b);double L=sqrt(a*a/4+(h+x)*(h+x));double y=L*b/a;double tot1=sqrt(y*y-b*b/4);double ans=(2*y*r)/b-tot1;printf("Stuck\n");printf("%.6f\n",ans);}}總結(jié)
以上是生活随笔為你收集整理的Ball Dropping的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 详细介绍四叉树 Quadtrees
- 下一篇: jHipster入门,第1部分